문제 바로가기> 백준 9237번: 이장님 초대
자라는데 가장 오래 걸리는 나무부터 심으면 이장님을 최대한 빨리 초대할 수 있다.
def solution():
import sys
input = sys.stdin.readline
n = int(input())
days = list(map(int, input().split()))
days.sort(reverse=True)
now, end = 0, 0
for i in days:
if end<now+1+i:
end = now+1+i
now+=1
print(end+1)
solution()