Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

Python: N = int(input())
a = b = 1
while N:
    a, b = b, a+b
    N -= 1
print(a)

Python: n = int(input())

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

print(fib[n])

Python: memo = [1, 1]

def fib(n):
    if (n < len(memo)):
        return memo[n]

    memo.append(fib(n-1) + fib(n-2))
    return memo[n]

N = int(input())
print(fib(N))

Python: import sys
m = int(input())
f = [0]*50
def fib(n):
  if n==0 or n==1:
    f[n] == 1
    return 1
  if f[n]!=0:
    return f[n]
  f[n] = fib(n-2) + fib(n-1)
  return f[n]

print(fib(m))

Python: n = int(input())

dp = [-1] * 100
dp[0] = 1
dp[1] = 1


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


if __name__ == "__main__":
    print(fib(n))

Python: #!/usr/bin/python3

# main
n = int(input()) - 1
fib = [1, 2]
for i in range(2, n + 1):
    fib.append(fib[i - 1] + fib[i - 2])
print(fib[n])

Python: # coding=utf-8


def fib(number):
    if number == 0 or number == 1:
        return 1
    memo1 = 1
    memo2 = 1

    for i in range(number-1):
        memo1, memo2 = memo1+memo2, memo1
    return memo1


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

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

Python: def main():
    import sys
    input=sys.stdin.readline

    n=int(input())
    if n==0 or n==1:
      print(1)
      return 
      
    dp=[0]*(1+n)
    dp[0]=1
    dp[1]=1
    for i in range(n-1):
        dp[i+2]=dp[i+1]+dp[i]
    
    print(dp[-1])   
 
if __name__=='__main__':
    main()

Python: def fibonacci(n):
    if n <= 1:
        return 1
    fib_array = [1] * 45

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

def main():
    n = int(input())
    fib = fibonacci(n)
    print(fib)
    return


main()

Python: n = int(input())
from functools import lru_cache
@lru_cache(maxsize=None)
def fib(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fib(n-2)+fib(n-1)
print(fib(n))

Python: n=int(input())
x, y=0, 1
for i in range(1, n+1):
    x, y=y, x+y
print(y)

Python: def fib(a, b, fiboli):
    if len(fiboli) < n:
        fiboli.append(fiboli[-1] + fiboli[-2])
        fib(fiboli[-1], fiboli[-1] + fiboli[-2], fiboli)
    else:
        print(fiboli[-1])
        print(fiboli)

n = int(input())
if n == 0 or n == 1:
    print(1)
elif n == 2:
    print(2)
else:
    fibo_list = []
    fibo_list.append(n - 1)
    fibo_list.append(n - 2)
    fib(n - 1, n - 2, fibo_list)

Python: N = int(input())

def solve(N):
    fib = [1]*(N+1)
    for i in range(2,N+1):
        fib[i] = fib[i-1] + fib[i-2]
    ans = fib[N]
    return ans
print(solve(N))

Python: n = int(input())


def memoize(f):
    memo = [1, 1] + [0] * max(0, n - 1)

    def main(i):
        if memo[i]:
            return memo[i]
        result = memo[i] = f(i)
        return result

    return main


@memoize
def fibonacci(i):
    return fibonacci(i - 1) + fibonacci(i - 2)


print(fibonacci(n))

Python: n = input()

if n == 0:
    print(1)
elif n == 1:
    print(1)
else:
    fib = [0 for i in range(n + 1)]

    fib[0] = 1
    fib[1] = 1

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

    print(fib[n])

Python: n = int(input())

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

print(f[n])

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

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]
    memo[n]=rec(n-1)+rec(n-2)
    return memo[n]

print(rec(N))

Python: def power(base,exp,op=lambda x,y:x*y,ie=1):
    res = ie
    while exp:
        if exp & 1:
            res = op(res,base)
        base = op(base,base)
        exp >>= 1
    return res

def fibonacci(n):
    I = [1,0,0,1]
    A = [1,1,1,0]
    mmul = lambda P,Q: [P[0]*Q[0]+P[1]*Q[2],P[0]*Q[1]+P[1]*Q[3],P[2]*Q[0]+P[3]*Q[2],P[2]*Q[1]+P[3]*Q[3]]
    return power(A,n+1,mmul,I)[2]

print(fibonacci(int(input())))

Python: # フィボナッチ数列 Fibonacci number

DP = [-1 for i in range(45)]
DP[0] = 1
DP[1] = 1

def fib(i):
    if DP[i] != -1:
        return DP[i]
    else:
        DP[i] = fib(i-1) + fib(i-2)
        return DP[i]

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

Python: import numpy as np
def f(n):
    m = np.matrix('1 1 ; 1 0') ** n
    return m.item(0)
print(f(int(input())))

Python: # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    n = int(readline())

    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[n])    


if __name__ == "__main__":
    main()

Python: n = int(input())

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

print(fib[n])

Python: import sys
input = sys.stdin.readline

m = [1, 1] + [None]*50

def fibonacci(n):
    if m[n-2]:
        pass
    else:
        fibonacci(n-2)
    if m[n-1]:
        pass
    else:
        fibonacci(n-1)

    m[n] = m[n-1] + m[n-2]

N = int(input())

fibonacci(44)
print(m[N])

Python: def fib(n: int, meolist: dict):
    if n == 0 or n == 1:
        meolist[n] = 1
        return 1
    elif n in meolist.keys():
        return meolist[n]
    
    meolist[n] = fib(n - 1, meolist) + fib(n - 2, meolist)
    return meolist[n]

if __name__ == '__main__':
    n = int(input())
    meolist = {}
    print(fib(n, meolist))

Python: def main():
    import sys
    N = int(sys.stdin.readline())
    L = [0 for i in range(45)]
    L[0], L[1] = 1, 1
    for i in range(2, 45):
        L[i] = L[i-1] + L[i-2]
    #print(L)
    print(L[N])
    



if __name__=='__main__':
    main()

Python: def fib(a, b, fiboli):
    if len(fiboli) < n:
        fiboli.append(fiboli[-1] + fiboli[-2])
        fib(fiboli[-1], fiboli[-1] + fiboli[-2], fiboli)
    else:
        print(fiboli[-1])
        print(fiboli)

n = 4
    # n = int(input())
if n == 0 or n == 1:
    print(1)
elif n == 2:
    print(2)
else:
    fibo_list = []
    fibo_list.append(n - 1)
    fibo_list.append(n - 2)
    fib(n - 1, n - 2, fibo_list)

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

if __name__ == '__main__':
    n = int(input())
    print(fibonacci(n))