본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#311 백준 파이썬 [1568] 새

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

 

PYTHON CODE

N = int(input())
time = 0

while N > 0: #N이 0이상일 때 까지
    i = 1
    while N - i >= 0: #1부터 다시
        N -= i
        i += 1
        time += 1
        
print(time)