1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# 1. Fibonacci
# 2. Memory를 고려해서 list를 생성 x
# 3. Python3 시간초과 PyPy : 7440 ms
def solution():
N = int(input())
# 1 --> 1
# 00 11 --> 2
# 001 100 110 --> 3
# 0000 1100 1111 0011 100 --> 5
start = 1
end = 2
next = 0
for i in range(2, N):
next = start + end
start = end
end = next
return next
print(solution()%15746)
|
'프로그래밍' 카테고리의 다른 글
[백준 11659 파이썬] 구간 합 구하기 4 (0) | 2020.02.24 |
---|---|
[백준 2805 파이썬] 나무자르기 (0) | 2020.02.23 |
[Python][Algorithm] Find Index Before Sorted (0) | 2020.01.27 |
[Python][Algorithm] 조합 Combination (0) | 2020.01.26 |
[Python] Operator overloading (0) | 2020.01.23 |