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())
s=[-1 for i in range(n+1)]

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

print(fib(n))

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


if __name__ == '__main__':
    main()

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

Python: n=int(input())
a,b=1,1
if n<=1:
    print(1)
else:
    for i in range(n-1):
        c=a+b
        a=b
        b=c
    print(c)

Python: def Fibonacci(n, a1, a2):
	if n<1 : return a1
	return Fibonacci(n-1,a1+a2,a1)

print( Fibonacci( int(input()), 1, 0 ) )

Python: n = int(input())
f = [1,1]
for _ in range(n-1):
    f_next = f[-1]+f[-2]
    f.append(f_next)
print(f[n])

Python: n = int(input())

fib = [0]*(n+1)

for i in range(n+1):
    if i==0 or i==1:
        fib[i] = 1
    else:
        fib[i] = fib[i-1] + fib[i-2]

print(fib[n])

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

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

answer=F[n]
print(answer)

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

Python: num = int(input())

dp = { 0: 1, 1: 1 }
def fibonacci(n):
  return dp[n] if n in dp else fibonacci(n - 1) + fibonacci(n - 2)

print(fibonacci(num))

Python: # import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd

def resolve():
    N=int(input())

    # dp[i]はh[i]までにかかるコストの最小値
    dp = [float('inf') for _ in range(N+1)]
    dp[0] = 1
    dp[1]=1


    for i in range(2,N+1):
        dp[i] = min(dp[i], dp[i - 1] + dp[i-2])
    print(dp[N])



resolve()

Python: n = int(input())
for i in range(n):
	a,b = b,a+b


print(a)

Python: a=1
b=1
c=[]
n=int(input())
c.append(a)
c.append(b)
for i in range(n):
    c.append(a+b)
    d=b
    b+=a
    a=d
print(c[n])

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

print(fib[-1])

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

Python: def fib(n):
    f0, f1 = 1, 1

    for i in range(n - 1):
        f1, f0 = f1 + f0, f1

    return f1

n = int(input())
ans = fib(n)

print(ans)

Python: answer_list = [1, 1] + [None] * 43

def fib(num):
    ans = answer_list[num]
    if ans:
        return ans
    ans = fib(num - 1) + fib(num - 2)
    answer_list[num] = ans
    return ans

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


# def fib_bad(n):
#     if not n or n == 1:
#         return 1
#     return fib_bad(n - 2) + fib_bad(n - 1)


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


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    index = int(_input[0])
    fib_list = [None] * index
    print(fib_dp(index))

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

Python: #!/usr/bin/env python3

n = int(input())

# TLE
# def fib(n):
#     if n == 0:
#         return 1
#     elif n == 1:
#         return 1
#     else:
#         return fib(n - 1) + fib(n - 2)
# print(fib(n))

dp = {}
dp[0] = 1
dp[1] = 1

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

print(dp[n])

Python: n = int(input())

def Fib(n):
    a, b = 0, 1
    if n == 0:
        return a + 1
    elif n == 1:
        return b
    else:
        for i in range(n):
            a, b = b, a + b
        return b

print(Fib(n))

Python: # -*- coding: utf-8 -*-
"""
Created on Thu Mar 21 21:43:51 2019

@author: Yamazaki Kenichi
"""

s = int(input())
#T = [-1 for i in range(s+1)]
#T[0],T[1] = 1,1
#def fib(n):
#    if T[n] != -1:
#        return T[n]
#    else:
#        T[n] = fib(n-2) + fib(n-1)
#        return T[n]
#print(fib(s))

F = [1,1]
for i in range(s):
    F.append(F[-2]+F[-1])
print(F[s])

Python: n = int(input())

fib=[]

fib.append(1)
fib.append(1)

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

print(fib[n])

Python: # coding: utf-8
# Your code here!

def fibo(n, memo = {}):
   if n == 0 or n == 1:
      return 1
   elif n in memo:
      return memo[n]
   else:
      memo[n] = fibo(n - 1, memo) + fibo(n - 2, memo)
      return memo[n]

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

Python: n = int(input())
memo = [1, 1] + [0 for _ in range(n-1)]
for i in range(n+1):
    if not memo[i]:
        memo[i] = memo[i - 1] + memo[i - 2]
print(memo[-1])

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

Python: n = int(input())
a = 1
b = 1
c = []
c.append(a)     
c.append(b)
#print(c)
for i in range(n):
        c.append(a+b) 
        #print(c)
        d = b
        b += a
        a = d
print(c[n])

Python: def fib_memo(n):
    memo = [-1]*(n+1)
    def fib(n):
        if n==0 or n==1:
            return 1
        if memo[n] != -1:
            return memo[n]
        memo[n] = fib(n-1) + fib(n-2)
        return memo[n]

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

Python: def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C

def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B

N=int(input())
vec=[[1,1],[1,0]]

vec=matpow(vec,N+1)
print(vec[1][0])

Python: a=1
b=1
c=[]
n=int(input())
c.append(a)
c.append(b)
for i in range(n):
  c.append(a+b)
  d=b
  b+=a
  a=d
print(c[n])

Python: # ALDS_10_A - フィボナッチ数

n = int(input())

dp = [0] * (n + 1)

for i in range(n + 1):
    if (i == 0) or (i == 1):
        dp[i] = 1
    else:
        dp[i] = dp[i - 1] + dp[i - 2]

print(dp[-1])
# print(dp)

Python: def main():
    def fib(n):
        a = 1
        b = 1
        if n == 0:
            return a
        elif n == 1:
            return b
        else:
            for i in range(n-1):
                a, b = b, a + b
            return b
    
    n = int(input())
    print(fib(n))
        
if __name__ == '__main__':
    main()

Python: a=1
b=1
c=[]
n=int(input())
c.append(a)
c.append(b)
for i in range(n):
  c.append(a+b)
  d=b
  b+=a
  a=d
print(c[n])

Python: import sys
n = int(input())
if n < 2:
    print(1)
    sys.exit()
a, b = 1, 1
for i in range(n-1):
    c = a + b
    a = b
    b = c
print(c)

Python: n = int(input())

A = [1]*(n+1)

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