[Python] ๋ฐฑ์ค #2910 - ๋น๋ ์ ๋ ฌ
๋ฌธ์ https://www.acmicpc.net/problem/2910 2910๋ฒ: ๋น๋ ์ ๋ ฌ ์ฒซ์งธ ์ค์ ๋ฉ์์ง์ ๊ธธ์ด N๊ณผ C๊ฐ ์ฃผ์ด์ง๋ค. (1 ≤ N ≤ 1,000, 1 ≤ C ≤ 1,000,000,000) ๋์งธ ์ค์ ๋ฉ์์ง ์์ด์ด ์ฃผ์ด์ง๋ค. www.acmicpc.net ํ์ด from collections import Counter n,m = map(int,input().split()) arr = list(map(int,input().split())) x = Counter(arr).most_common() for a,b in x: for _ in range(b): print(a,end=' ') Counter(arr).most_common()๋ฅผ ์ฌ์ฉํด์ค๋ค. ๊บ ์์ฝ๋ฉ ๋ ์ฌ๋ผ๊ฐ๋ค!
[Python] ๋ฐฑ์ค #2636 - ์น์ฆ
๋ฌธ์ https://www.acmicpc.net/problem/2636 2636๋ฒ: ์น์ฆ ์๋ ๊ณผ ๊ฐ์ด ์ ์ฌ๊ฐํ ์นธ๋ค๋ก ์ด๋ฃจ์ด์ง ์ฌ๊ฐํ ๋ชจ์์ ํ์ด ์๊ณ , ๊ทธ ์์ ์์ ์น์ฆ(ํ์์ผ๋ก ํ์๋ ๋ถ๋ถ)๊ฐ ๋์ฌ ์๋ค. ํ์ ๊ฐ์ฅ์๋ฆฌ(์์ ๋ค๋ชจ ์นธ์ X์น ๋ถ๋ถ)์๋ ์น์ฆ๊ฐ ๋ www.acmicpc.net ํ์ด from collections import deque import queue import sys import copy n,m = map(int,input().split()) arr = [list(map(int,sys.stdin.readline().split())) for _ in range(n)] dx = [1,0,-1,0] dy = [0,1,0,-1] # ์น์ฆ๋
น์ด๊ธฐ def melt(): global n,..