BOJ - 9237 - 이장님 초대

Updated:

import sys

def solution():
    N = int(sys.stdin.readline())
    Tree = list(map(int, sys.stdin.readline().split()))

    Tree.sort(reverse=True)

    ret = []
    for i in range(N):
        ret.append(i + Tree[i])
    print(max(ret)+2)
solution()

https://www.acmicpc.net/problem/9237

Categories:

Updated:

Leave a comment