백준 16435번 스네이크버드 https://www.acmicpc.net/problem/16435 코드 설명 오름차순으로 정렬한 뒤 비교하면 훨씬 수월하게 문제를 해결할 수 있다. 소스코드 메모리 : 30860 KB 시간 : 72 ms n, l = map(int, input().split()) fruit = list(map(int, input().split())) fruit.sort() for f in fruit: if l >= f: l += 1 print(l)