์๊ณ ๋ฆฌ์ฆ ๐ฉ๐ป๐ป70 [BAEKJOON] 9375 | ํจ์ ์ ์ ํด๋น ๐ 9375 | ํจ์ ์ ์ ํด๋นhttps://www.acmicpc.net/problem/9375๐ก Solution์ท๋ค์ ์กฐํฉ์ ๊ตฌํ๋ ๋ฌธ์ ์ด๋ฏ๋ก ๋จผ์ ์์ ์ข ๋ฅ ๋ณ๋ก ์์์ ์๋ฅผ ์ผ๋ค. ์ด ๋ dictionary๋ฅผ ์ด์ฉํ์๋ค.(์์์ ์ + ์์ ๋ ๊ฒฝ์ฐ์ ์)๋ฅผ ์์์ ์ข ๋ฅ ๋ณ๋ก ๊ณฑํด์ฃผ๊ณ ์๋ชธ์ธ ๊ฒฝ์ฐ์ ์๋ฅผ ํ๋ ๋นผ์ค๋ค.def countClothingCombinations(n) : clothing = {} result = 1 for i in range(n) : clothing_name, clothing_type = input().split() if clothing_type in clothing : clothing[clothing.. 2024. 12. 19. [BAEKJOON] 1946 | ์ ์ ์ฌ์ ๐ 1946 | ์๋ฆฌ์ผ ๋ฒํธhttps://www.acmicpc.net/problem/1946๐ก Solution๋จผ์ ์๋ฅ ์ฑ์ ๊ณผ ๋ฉด์ ์ฑ์ ์ ๋ชจ๋ ์ ๋ ฅ ๋ฐ์ listํํ๋ค.์๋ฅ ์ฑ์ ์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌํ๋ค.๋ณธ์ธ๋ณด๋ค ์๋ฅ ์ฑ์ ์ด ์ข์ ์ฌ๋๋ค ์ค ๊ฐ์ฅ ์ข์ ๋ฉด์ ์ฑ์ ๋ณด๋ค ๋ฉด์ ์ฑ์ ์ด ์ข์ผ๋ฉด ํฉ๊ฒฉ์ด๋ค.์ด ๋, ์๋ฅ ์ฑ์ ์ด 1๋ฑ์ธ ์ฌ๋์ ์ ๋ ๋ค๋ฅธ ์ง์์๋ณด๋ค ๋ชจ๋ ์ฑ์ ์ด ๋จ์ด์ง ์ ์์ผ๋ฏ๋ก ๋ฌด์กฐ๊ฑด ์ ๋ฐ์ด๋ค.import sysinput = sys.stdin.readlinedef find_passed_count(n) : count = 1 candidates = [] for i in range(n) : document_score, interview_score = map(int, input(.. 2024. 12. 19. [BAEKJOON] 14425 | ๋ฌธ์์ด ์งํฉ ๐ 14425 | ๋ฌธ์์ด ์งํฉhttps://www.acmicpc.net/problem/14425๐ก Solution์งํฉ์ ํฌํจ๋๋ ๋ฌธ์์ด์ ์ธํ ํ, ์ ๋ ฅ๋๋ ๋ฌธ์์ด์ด ์งํฉ์ ์กด์ฌํ๋์ง ํ์ธํ๋ค.n, m = map(int, input().split())str_set = set()result = 0for i in range(n) : str_set.add(input().rstrip()) for i in range(m) : if input().rstrip() in str_set : result += 1 print(result) 2024. 12. 19. [BAEKJOON] 1431 | ์๋ฆฌ์ผ ๋ฒํธ ๐ 1431 | ์๋ฆฌ์ผ ๋ฒํธhttps://www.acmicpc.net/problem/1431๐ก Solutionserial ๋ฒํธ์ ๊ธธ์ด ์ค๋ฆ์ฐจ์, serial ๋ฒํธ์ ์ซ์ ํฉ ์ค๋ฆ์ฐจ์, serial ๋ฒํธ ์ฌ์ ์ ๋ ฌ ์ค๋ฆ์ฐจ์์ผ๋ก ์ ๋ ฌํ๋ค.def sumNum(serial) : return sum(int(ch) for ch in serial if ch.isdigit()) def key_function(serial) : return (len(serial), sumNum(serial), serial)n = int(input().rstrip())guitar = []for i in range(n) : guitar.append(input().rstrip()) guitar.sort(key=k.. 2024. 12. 18. ์ด์ 1 2 3 4 ยทยทยท 18 ๋ค์