파게로그

[백준 10870번] 피보나치 본문

콤퓨타 왕왕기초/PS

[백준 10870번] 피보나치

파게 2020. 10. 30. 19:06

문제 링크: 백준 10870번 피보나치 수 5

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

 

DP 없이 피보나치 수 느리게 구하기!

 

def fibo(n):
    if n==0: return 0
    if n==1: return 1
    
    return fibo(n-1)+fibo(n-2)

n = int(input())
print(fibo(n))
Comments