📁 코딩테스트 준비/Python

[그리디 / python] 모험가 길드

박개봄 2022. 11. 11. 14:11
728x90

문제풀이

n=map(int, input().split())
data=list(map(int, input().split()))
data.sort()
result=0
cnt=0

for i in data:
    cnt+=1
    if cnt>=i:
        result += 1
        cnt=0

print(result)

정렬하는 것 까진 생각 했는데,,,^^ㅠ

분발하자...

728x90