반응형
https://www.acmicpc.net/problem/1417
# @Author YoungMinKim
# baekjoon
N=int(input())
ls=[]
for i in range(N):
ls.append(int(input()))
dasom = ls[0]
rev = ls[1:N]
if N == 1:
print(0)
else:
num=0
rev= sorted(rev,reverse=True)
while rev[0]>=dasom:
dasom+=1
rev[0]-=1
num+=1
rev = sorted(rev,reverse=True)
print(num)
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 1550 (0) | 2020.08.21 |
---|---|
baekjoon - python - 1546 (0) | 2020.08.21 |
baekjoon - python - 1373 (0) | 2020.08.21 |
baekjoon - python - 1330 (0) | 2020.08.21 |
baekjoon - python - 1237 (0) | 2020.08.21 |
댓글