본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 26941번 Pyramidbygge

by 현장 2023. 3. 28.

-Code

n = int(input())
pyramid = 0
res = 0
cnt = 1
while 1:
    pyramid += cnt ** 2
    cnt += 2

    if pyramid > n:
        break
    res += 1
print(res)