백준 2292 (파이썬)

김덕현·2021년 7월 3일
1

BAEKJOON

목록 보기
52/62

1.문제

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

2.코드

n=int(input())
d=1
cnt=1
mx=1
if(n==1):
    print(n)
else:
    while True:
        mx+=d*6
        cnt+=1
        if(n<=mx):
            break
        d+=1
    print(cnt)

3.코드해설

profile
BAEKJOON STUDYING

0개의 댓글