Go: package main

import (
	"fmt"
)

const MAX = 45

var dp [MAX]int

func fin(n int) int {
	if dp[n] != 0 {
		return dp[n]
	}

	switch n {
	case 0:
		dp[n] = 1
	case 1:
		dp[n] = 1
	default:
		dp[n] = fin(n-1) + fin(n-2)
	}
	return dp[n]
}

func main() {
	var n int
	fmt.Scan(&n)
	fmt.Println(fin(n))
}

Python: n = int(input()) + 1
a = [0] * n
a[0] = 1
a[1] = 1
for i in range(2, n):
    a[i] = a[i-1] + a[i-2]
print(a[-1])

Python: # coding=utf-8


def fib(number):
    if number == 0 or number == 1:
        return 1
    return fib(number-1) + fib(number-2)


if __name__ == '__main__':
    N = int(input())
    print(fib(N))

Python: # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(100000)

calculated = set([0, 1])
cal_fib = [0 for _ in range(45)]
cal_fib[0:2] = 1, 1

def fib(n):
    if cal_fib[n] == 0:
        cal_fib[n] = fib(n-1) + fib(n-2)
    return cal_fib[n]

n = int(input())
print(fib(n))

Python: n = int(input())
a =[1,1]
if n < 2:
    pass
else:
    for i in range(2,n+1):
        a.append(a[i-1]+a[i-2])
    
print(a[n])

Python: n = int(input())
arr = [1, 1]
for i in range(2, 45):
    arr.append(arr[i - 1] + arr[i - 2])
print(arr[n])

Python: n = int(input())

F = [0]*(n+1)
if n == 0:
    print(1)
elif n==1:
    print(1)
elif n > 1:
    F[0] = 1
    F[1] = 1

    for i in range(2,n+1):
        F[i] = F[i-1] + F[i-2]

    print(F[-1])

Python: n = int(input())
fib = [0]*45
fib[0] = 1
fib[1] = 1
for i in range(2,45):
    fib[i] = fib[i-1] + fib[i-2]
print(fib[n])

Python: def fib(n):
    n=int(n)
    F=[1,1]
    for i in range(1,n):
        F.append(F[i-1]+F[i])
    
    return F[n]
    
a=input(int())
fib(a)

Python: l=[1,1]
n=int(input())
for i in range(n):
    fib=[l[i]+l[i+1]]
    l=l+fib
print(l[n])

Python: lis=[]
lis.append(1)
lis.append(1)
for i in range(2,45):
    lis.append(lis[i-1]+lis[i-2])

n = int(input())
print(lis[n])

Python: import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def fib(dp, n):
    if n == 0 or n == 1:
        dp[n] = 1
        return dp[n]
    if dp[n] != -1:
        return dp[n]
    dp[n] = fib(dp, n - 1) + fib(dp, n - 2)
    return dp[n]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    fb = [-1] * (N + 1)
    print(fib(fb, N))


if __name__ == '__main__':
    main()

Python: # -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N=INT()

memo=[0]*50
memo[0]=memo[1]=1
def rec(n):
    if memo[n]:
        return memo[n]
    return rec(n-1)+rec(n-2)

print(rec(N))

Python: n = int(input())
fib = [1, 1]

for i in range(2, n+1):
    fib.append(fib[i-1] + fib[i-2])

print(fib.pop())

Python: n = int(input())
def fib(x):
    lst=[1,1]
    for i in range(x-1):
        z = len(lst)
        y = int(lst[z-2])+int(lst[z-1])
        lst.append(y)
    print(lst[x])
fib(n)

Python: n = int(input())
fib = [1]*45
for i in range(2,n+1):
  fib[i] = fib[i-1]+fib[i-2]
print(fib[n])

Python: def deco_fibo(func):
    answer_list = [1, 1] + [None] * 43
    def main_fibo(i):
        ans = answer_list[i]
        if ans:
            return ans
        ans = func(i)
        answer_list[i] = ans
        return ans
    return main_fibo

@deco_fibo
def fibo(num):
    return fibo(num - 1) + fibo(num - 2)


n = int(input())

print(fibo(n))

Python: memo = [0, 1]

def fib(n):
    if (n in memo):
        return memo[n]
    ans = fib(n-1) + fib(n-2)
    memo.append(ans)
    return ans

n = int(input())
print(fib(n))

Python: n=int(input())
if n==0 or n==1:
    print(1)
else:
    N=1
    m=1
    for i in range(n-1):
        M=N+m
        m=N
        N=M
    print(M)

Python: list=[1,1]
n=int(input())

t=0
sum=0
if n==0 or n==1:
    print(1)
else:
    for i in range(n):
        list.append(list[i]+list[i+1])
    print(list[n])

Python: import sys

n = int(sys.stdin.readline().strip())

fib = [0] * (n+1)
fib[0] = 1
fib[1] = 1

for i in range(2, n+1):
    fib[i] = fib[i-1] + fib[i-2]
print(fib[n])

Python: n = int(input())
fib = [0] * (n + 1)
fib[0] = 1
if n > 0: fib[1] = 1
for i in range(2, n+1):
    fib[i] = fib[i-1] + fib[i-2]
print(fib[n])

Python: def g(a,b,n):
    if n==0 or n==1: return a
    else: return g(a+b,a,n-1)
a,b=1,1
print(g(a,b,int(input())))

Python: # def fibb(n):
#     if n == 1 or n == 2:
#         return 1
#     else:
#         return fibb(n-1)+fibb(n-2)

n = int(input())
fibb = [0]*45
fibb[0:2] = [1,1]
for i in range(2,45):
    fibb[i] = fibb[i-1] + fibb[i-2]
print(fibb[n])

Python: def fib(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    if F[n] > 0:
        return F[n]
    F[n] = fib(n-1) + fib(n-2)
    return F[n]

n = int(input())
F = [0 for i in range(n+1)]
print(fib(n))

Python: def resolve():
    n = int(input())
    A = [1, 1]
    for i in range(1, 45):
        A.append(A[i - 1] + A[i])
    print(A[n])


resolve()

Python: import sys
input = sys.stdin.readline

n = int(input())
F = [1]*50
for i in range(2, n+1):
    F[i] = F[i-1] + F[i-2]

print(F[n])

Python: def fib(n, fib_table):
    if n == 0 or n == 1:
        return 1
    if fib_table[n] != None:
        return fib_table[n]
    fib_table[n] = fib(n-1, fib_table) + fib(n-2, fib_table)
    return fib_table[n]

n = int(input())
fib_table = [None]*(n+1)
fib_table[0] = 1
fib_table[1] = 1

print(fib(n, fib_table))

Python: memo = [1, 1]

def fib(n):
    if (n in memo):
        return memo[n]
    ans = fib(n-1) + fib(n-2)
    memo.append(ans)
    return ans

n = int(input())
print(fib(n))

Python: # -*- coding: utf-8 -*-
"""
Created on Fri May  4 20:13:10 2018
ALDS1_10_A
@author: maezawa
"""

fib_arr = [None for _ in range(45)]
fib_arr[0] = 1
fib_arr[1] = 1

def fib(n):
    if fib_arr[n] != None:
        return fib_arr[n]
    fib_arr[n] = fib(n-1)+fib(n-2)
    return fib_arr[n]
    
n = int(input())
print(fib(n))

Python: x=int(input())
if x == 0 or x == 1 : print("1")
else : 
    i=0
    b=1
    c=1
    while i<(x-1) :
        d=b+c
        c=b
        b=d
        i=i+1
        
    print(b)

Python: n = int(input())
f = [0]*(n+3)
f[0], f[1] = 1, 1
for i in range(2, n+1):
    f[i] = f[i-1]+f[i-2]
print(f[n])

Python: import sys
input = sys.stdin.readline

n = int(input())
F = [1]*50
for i in range(2, n+1):
    F[i] = F[i-1] + F[i-2]

print(F[n])

Python: N = int(input())
dp = [0]*(N+1)
dp[0] = 1
dp[1] = 1
for i in range(2, N+1):
    dp[i] = dp[i-1]+dp[i-2]
print(dp[-1])

Python: n=int(input())
a=1
b=1
i=0
while i<n:
  a, b=b, a+b
  i+=1
print(a)

Python: #!/usr/bin/python

n = int(input())

def fib(n):
    l = list()
    l.append(1)
    l.append(1)

    for i in range(2, n+1):
        l.append(l[i-1] + l[i-2])

    return l[-1]

print(fib(n))

Python: def fib(n):
    if n == 0 or n == 1:
        return 1
    return fib(n-1) + fib(n-2)

n = int(input())
print(fib(n))

Python: def fib(n):
  if n ==1 or n == 0:
    return 1
  else:
    return fib(n-1) + fib(n-2)
  
print(fib(int(input())))