문제
https://www.acmicpc.net/problem/2292
걸린 시간
00 : 20 : 11
풀이
Python3
if __name__ == "__main__":
N = int(input())
left = 2
right = 7
count = 1
while True:
if N == 1:
count = 0
break
if N >= left and N <= right:
break
left += 6 * (count)
right += 6 * (count+1)
count += 1
print(count+1)
'Baekjoon' 카테고리의 다른 글
Baekjoon 2869번 달팽이는 올라가고 싶다 (0) | 2020.07.26 |
---|---|
Baekjoon 2775번 부녀회장이 될테야 (0) | 2020.07.26 |
Baekjoon 2231번 분해합 (0) | 2020.07.26 |
Baekjoon 10989번 수 정렬하기 3 (0) | 2020.07.26 |
Baekjoon 10866번 덱 (0) | 2020.07.26 |
댓글