Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

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

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

Python: n = int(input())
fib_b = [1,1]
if n > 1:
    for i in range(2,n+1):
        fib_b.append(fib_b[i-1]+fib_b[i-2])

print(fib_b[n])

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

print(fib(int(input())))

Python: n = int(input().strip())
if n == 0:
    print(1)
elif n == 1:
    print(1)
else:
    lst = [0 for i in range(0,n+1)]
    lst[0] = 1
    lst[1] = 1
    for i in range(0,n-1):
        lst[i+2] = lst[i+1] + lst[i]
    print(lst[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: 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())

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

Python: def makeFibonacci(n):
    if n <= 1:
        return str(1)
    F = [None]*(n+1)
    F[0] = 1
    F[1] = 1
    for i in range(2, n+1):
        F[i] = F[i-1] + F[i - 2]
    return str(F[n])

n = int(input())
print(makeFibonacci(n))

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

Python: n=int(input())
def Fib(n):
    a,b=0,1
    for i in range(n):
        a,b=b,a+b
    return b
print(Fib(n))

Python: #coding:UTF-8
def FN(n):
    if n==0 or n==1:
        return 1
    else:
        ans=FN(n-1)+FN(n-2)
        return ans
if __name__=="__main__":
    n=int(input())
    ans=FN(n)
    print(ans)

Python: F = {}

def fib(n):
  global F
  if n < 0:
    print("error")
    exit()
  if n < 2:
    F[n] = 1
    return F[n]
#  F[n] = fib(n-1) + fib(n-2)
  F[n] = F(n-1) + F(n-2)
  return F[n]

n = int(input())
print(fib(n))
#n = int(input())
#print(fib(n))
#fib(44)
#for i in range(5+1):
#  print(F[i])

Python: # Fibonacci Number

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

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


print( fib( int( input() ) ) )

Python: n = int(input())
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())
dp=[0]*(n+1)
dp[0],dp[1]=1,1
for i in range(2,n+1):
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n])

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

Python: A = {}
def fibonacci(n):
    global A
    if n == 0 or n == 1:
        A[n] = 1
        return A[n]
    if n in A:
        return A[n]
    else:
        A[n] = fibonacci(n - 2) + fibonacci(n - 1)
        return A[n]

n = int(input())
print(fibonacci(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: N = int(input())

DP = [0 for _ in range(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])

Python: n = int(input())

from functools import lru_cache
@lru_cache(maxsize=None)
def fibo(n: int):
    if n == 0 or n == 1:
        return 1
    return fibo(n-1) + fibo(n-2)

print(fibo(n))

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: f=[None for i in range(45)]

def fib(n):
    if n==0 or n==1:
        if f[n] is None:
            f[n] = 1
        return 1
    else:
        if f[n-2] is not None:
            f_n_2 = f[n-2]
        else:
            f_n_2 = fib(n-2)
            f[n-2] = f_n_2
        if f[n-1] is not None:
            f_n_1 =  f[n-1]
        else:
            f_n_1 = fib(n-1)
            f[n-1] = f_n_1
        f[n] = f_n_1 + f_n_2
        return f[n]
n = int(input())
print(fib(n))

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


if __name__ == "__main__":
    main()

Python: MAX_N = 44
_memo = [None for _ in range(MAX_N + 1)]
_memo [0] = _memo[1] = 1

def fibonacci(n):
    
    if _memo[n] is not None:
        return _memo[n]
    else:
        _memo[n] = fibonacci(n - 1) + fibonacci(n - 2)
        return _memo[n]

if __name__ == '__main__':
    n = int(input())
    print(fibonacci(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: from functools import lru_cache
n = int(input())

@lru_cache(maxsize=None)


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

Python: from functools import lru_cache


@lru_cache(maxsize=None)
def fib(n):
    """ http://docs.python.jp/3/library/functools.html """
    if n < 2:
        return n
    return fib(n-1) + fib(n-2)


class Fibonacci(object):
    memo = [1, 1]

    def get_nth(self, n):
        if n < len(Fibonacci.memo):
            return Fibonacci.memo[n]
        # print('fib({0}) not found'.format(n))
        for i in range(len(Fibonacci.memo), n+1):
            result = Fibonacci.memo[i-1] + Fibonacci.memo[i-2]
            Fibonacci.memo.append(result)
            # print('fib({0})={1} append'.format(i, result))
        return Fibonacci.memo[n]


if __name__ == '__main__':
    # ??????????????\???
    num = int(input())

    # ?????£??????????????°????¨????
    f = Fibonacci()
    result = f.get_nth(num)
    #result = fib(num+1)

    # ???????????????
    print('{0}'.format(result))

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())