Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

Python: n = int(input())
def fib(n):
    m = [1,1]
    if n==0 or n==1:
        m=[1]
    else:
        for k in range(2,n+1):
            m.append(m[-1]+m[-2])
    return m

if n==0:
    l = fib(n)[n]
elif n==1:
    l = fib(n)[n-1]
else:
    l = fib(n)[n]
print(l)

Python: def main():
    N = int(input())
    done = [False for i in range(N + 1)]
    memo = [0 for i in range(N + 1)]

    def do_dp(n):
        if done[n]:
            return memo[n]
        if n == 0:
            return 1
        elif n == 1:
            return 1
        else:
            memo[n] = do_dp(n - 1) + do_dp(n - 2)
            done[n] = True
            return memo[n]
    
    print(do_dp(N))

if __name__ == '__main__':
    main()

Python: n=int(input())

a=1
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):
  fib.append(fib[-1]+fib[-2])
print(fib[-1])

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Python: def fibonacchi(n: int) -> int:
    global computed_result
    if computed_result.get(n):
        return computed_result[n]
    else:
        computed_result[n] = fibonacchi(n - 2) + fibonacchi(n - 1)
        return computed_result[n]


if __name__ == "__main__":
    n = int(input())
    computed_result = {0 : 1, 1: 1}
    print(f"{fibonacchi(n)}")

Python: n= int(input())
if n <= 1:
  print(1)
  exit()
fib_ = [0]*(n+1)
fib_[0] = 1
fib_[1] = 1

def fib(n):
  if fib_[n] >= 1:
    return fib_[n]
  else:
    fib_[n] = fib(n-1)+fib(n-2)
    return fib(n-1)+fib(n-2)
print(fib(n))

Python: def fib(n):
    if n == 0 or n == 1:
        ans[n] = 1
        return 1
    # ?????¢???????¨?????????????????´???§????????°?????????????????????
    if ans[n] != -1:
        return ans[n]

    ans[n] = fib(n-1) + fib(n-2)
    return ans[n]


N = int(input())
ans = [-1 for i in range(N+1)]
a = fib(N)
print(a)

Python: _fib = [0] * 45

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

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

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

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

Python: # coding: utf-8

def fib(a, b, c):
    if c==0:
        return a
    return fib(a+b, a, c-1)
    
n = int(input().rstrip())
print(fib(0, 1, n+1))

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

Python: n=int(input())
dp=[0]*(n+1)
dp[0]=1
dp[1]=1


def rec(x):
    if dp[x]>0:
        return dp[x]

    res=rec(x-1)+rec(x-2)
    dp[x]=res
    return dp[x]

print(rec(n))

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

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

    print(F[n])

Python: n = int(input())

num = [1,1]

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

Python: def resolve():
    '''
    code here
    '''
    import sys

    sys.setrecursionlimit(100000000)
    N = int(input())

    memo = [0 for _ in range(N+1)]

    def fina(n):
        if n <= 1:
            memo[n] = 1
            return 1

        if memo[n] != 0:
            return memo[n]

        memo[n-1] = fina(n-1)
        memo[n-2] = fina(n-2)        
        memo[n] = memo[n-1] + memo[n-2]

        return memo[n]
    
    print(fina(N))



if __name__ == "__main__":
    resolve()

Python: n = int(input())
a = int(0)
b = int(1)

if n==1:
    A = b
elif n==2:
    A = 2
else:
    for i in range(n):
        a,b = b,a+b
        A = b

print(A)

Python: n = int(input())
dp = [0]*(n+1)
def fibo(n):
  if n <2:
    return 1
  if dp[n]  > 0:
    return dp[n]
  dp[n] = fibo(n-1) + fibo(n -2)
  return dp[n]
print(fibo(n))

Python: import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

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

main()

Python: n = int(input())
def fib(i):
    if i<=1: return 1
    else: 
     a=0
     b=1
     for i in range(n+1):
      c=b+a
      b=a
      a=c
     return c
print(fib(n))

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

print(dp[n])

Python: # coding: utf-8
# 40

n = int(input())
a = int(0)
b = int(1)

if n==1:
    A = b
elif n==2:
    A = 2
else:
    for i in range(n):
        a,b = b,a+b
        A = b

print(A)

Python: n = int(input())
f = [0]*45
f[0] = 1
f[1] = 1

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