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())
def fib(n):
     a=1
     b=1
     for _ in range(n):
          a,b=b,a+b
     return a
print(fib(n))

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

Python: from functools import lru_cache

@lru_cache(maxsize=None)
def Fib(n) :
    if n == 0 :
        return 1
    elif n == 1 :
        return 1
    else :
        return Fib(n-1) + Fib(n-2)

N = int(input())
print(Fib(N))

Python: n = int(input())

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

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


print(fib[n])

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

Python: from functools import lru_cache


@lru_cache(maxsize=None)
def fib(n):
    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())


def fibo(n, cache):
    cache[0] = 1
    cache[1] = 1
    for n in range(2, N+1):
        cache[n] = cache[n-1] + cache[n-2]
    return cache


print(fibo(N, [-1]*(N+1))[N])

Python: N = int(input())

memo = []

memo = [1,1] + [0] * (N - 1)

def f(n):
    if memo[n] == 0:
        memo[n] = f(n-1) + f(n-2)
        return(memo[n])
    if memo[n] != 0:
        return(memo[n])

print(f(N))

Python: # -*- coding: utf-8 -*-
fibs = {0: 1, 1: 1}


def fib(n):
    if n not in fibs:
        fibs[n] = fib(n - 1) + fib(n - 2)

    return fibs[n]


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

Python: memo = {}


def fib(n):
    """
    :param n: non-negative integer
    :return: n-th fibonacci number
    """
    if n == 0 or n == 1:
        return 1

    try:
        return memo[n]
    except KeyError:
        pass

    res = fib(n-1) + fib(n-2)
    memo[n] = res

    return res


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

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

Python: n = int(input())
if n < 3:
    print(n)
else:
    n_1 = 1
    n_2 = 1
    for i in range(2, n+1):
        n_0 = n_1 + n_2
        n_2, n_1 = n_1, n_0
    print(n_0)

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

n=int(input())        
print(f(n+1))

Python: #DPによるフィボナッチ数列
n = int(input())

dp = [-1] * (n+1) #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: F = [0 for i in range(50)]
F[0] = 1
F[1] = 1

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

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

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

n = int(input())
print(fibonacci(n))

Python: f=[1,1]
for _ in range(2,45):f+=[sum(f[-2:])]
print(f[int(input())])

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

Python: def main():
    n = int(input())
    if n <= 1:
        print(1)
    else:
        fib_list = [1, 1] + [None] * (n - 1)
        for i in range(2, n + 1):
            fib_list[i] = fib_list[i - 1] + fib_list[i - 2]
        print(fib_list[n])


if __name__ == "__main__":
    main()

Python: import sys
sys.setrecursionlimit(15000)
n = int(input())

memo = {0:1,1:1}

def fib(n):
  if n < 2:
    return memo[n]
  if not n in memo:
    memo[n] = fib(n-1)+fib(n-2)
  return memo[n]

print(fib(n))

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

Python: f=[1,1]
for _ in[0]*43:f+=[f[-2]+f[-1]]
print(f[int(input())])

Python: def solve(n):
    if n <= 1:
        print(1)
        return

    a, b = 1, 1
    for _ in range(2, n + 1):
        c = a + b
        b = a
        a = c
    print(c)

if __name__ == "__main__":
    n = int(input())
    solve(n)

Python: def fibonacci(n):
    a = [1]*2
    for i in range(2,n+1):
        a[0],a[1] = a[1],a[0]+a[1]
    return a[1]

n = int(input())
print(fibonacci(n))

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

Python: n = int(input())
l = [0 for _ in range(10**4)]
def fib(n):
    if n==0:
      l[0]=1
      return 1
    if n==1:
      l[1]=1
      return 1
    if l[n]!=0:
      return l[n]
    else:
      l[n]=fib(n-1)+fib(n-2)
      return fib(n-1)+fib(n-2)
    
print(fib(n))

Python: class Fib:
    def __init__(self):
        self.FIB = [1, 1]

    def fib(self, n):
        if n < len(self.FIB):
            return self.FIB[n]
        else:
            self.FIB.append(self.fib(n-1) + self.fib(n-2))
            return self.FIB[n]


N = int(input())
f = Fib()
print(f.fib(N))

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

Python: n=int(input())

dp=[0 for _ in range(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: def fib(n):
    a = 1
    b = 1
    if n == 0:
        print(a)
    elif n == 1:
        print(b)
    else:
        for i in range(n-1):
            c = a + b
            a , b = b , c
        print(c)

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