문제 풀이/Baekjoon Online Judge

[python3] 2292번 벌집

[잉간] 2018. 3. 15. 20:47


6으로 곱한뒤 더해나가며 계속 비교하면 된다.

N = int(input())
b = 1
c = 1

while b < N:
	b += c * 6
	c += 1
print(c)


저작자표시 비영리 동일조건 (새창열림)