ํ• ๋ฆฌ๊ฐˆ๋ฆฌ

๐Ÿฅ‰ Bronze2  โœ… 1๋ฒˆ ํ’€์ด: counterfrom collections import Counterimport sysinput = sys.stdin.readlinen=int(input())fruits_counter=Counter()for _ in range(n): fruit,num=input().split() fruits_counter[fruit]+=int(num)print('YES' if 5 in fruits_counter.values() else 'NO')๋ฉ”๋ชจ๋ฆฌ์‹คํ–‰์‹œ๊ฐ„34008140 ์ฒ˜์Œ ํ’€์—ˆ์„๋• ์นด์šดํŠธ๋ฅผ ํ•ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์—, counter ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•ด์„œ ํ’€์—ˆ๋‹ค.๋ฐ”๋‚˜๋‚˜5, ๋ฐ”๋‚˜๋‚˜5 = ๋ฐ”๋‚˜๋‚˜10๊ฐœ์˜ ๊ฒฝ์šฐ์—” NO๋ฅผ ์ถœ๋ ฅํ•ด์•ผํ•˜๋ฏ€๋กœ, for๋ฌธ์„ ์ˆœํšŒ์ค‘์— 5๊ฐ€ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ..
Yuuuki
'ํ• ๋ฆฌ๊ฐˆ๋ฆฌ' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก