๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์•Œ๊ณ ๋ฆฌ์ฆ˜ ๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป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.