출처: http://vallista.tistory.com/entry/Syntax-Highlighter-티스토리에서-코드-이쁘게-넣기 [VallistA]>

posted by ddanss 2019. 2. 7. 12:23
728x90
x=int(input())

def dp(x):
dpl = [1, 1]
if(x==1 or x==2):
return 1
for i in range(2,x):
dpl.append(dpl[i-1]+dpl[i-2])
return dpl[x-1]

print(dp(x))

 

반응형

'백준' 카테고리의 다른 글

6603 로또 (백트랙킹  (0) 2019.07.19
11656 - 접미사 배열(문자열 알파벳순서정렬)  (0) 2018.12.24
2711 - 오타맨 고창영  (0) 2018.09.11
백준 2587 - 대표값2 [C언어]  (0) 2018.09.11
백준 2592 - 대표값 [C언어]  (0) 2018.09.11