Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

Python: N = int(input())

def memorize(f) :
    cache = {}
    def helper(*args) :
        if args not in cache :
            cache[args] = f(*args)
        return cache[args]
    return helper

@memorize
def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    res = fibonacci(n - 2) + fibonacci(n - 1)
    return res

print(fibonacci(N))

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

def main():
    n = int(input())
    F  = [0]*(n+1)
    ans = fibonacci(F,n)
    return ans

print(main())

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

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

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

print(ans)

Python: def fibr(n):
    if arr[n] != 0:
        return arr[n]
    if n < 2:
        arr[n] = 1
    else:
        arr[n] = fibr(n-1) + fibr(n-2)
    return arr[n]

n = int(input())
arr = [0 for i in range(n+1)]
print(fibr(n))

Python: n = int(input())
n1 = 1
n2 = 1

for i in range(n):
    n1, n2 = n2, n1+n2

print(n1)

Python: import sys
n=int(input())

if n<=1:
    print(1)
    sys.exit()
else:
    i=1
    a0=1
    a1=1
    while i<=n-1:
        temp=a1
        a1+=a0
        a0=temp
        i+=1
print(a1)

Python: inf = 10**9+7
mod = 10**9+7
n = int(input())
dp = [1 for i in range(n+1)]
for i in range(2,n+1):
    dp[i] = dp[i-2] + dp[i-1]
print(dp[n])

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

Python: def fib(n,memo={}):
    if n==0 or n==1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n]= fib(n-1,memo)+fib(n-2,memo)
        return memo[n]
n=int(input())
print(fib(n))

Python: n = int(input())
pair = [1, 1]

for i in range(n - 1):
    pair[i % 2] = sum(pair)

print(pair[n % 2])

Python: n = int(input())

n_L = [0] * 45

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

print(n_L[n])

Python: a=b=1
for _ in range(int(input())):a,b=b,a+b
print(a)

Python: def fib(n):
    F = {}
    F[0], F[1] = 1, 1

    if n == 1 or n == 0:
        return 1

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

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

Python: print([1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155, 165580141, 267914296, 433494437, 701408733, 1134903170][int(input())])

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

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

Python: def fib(n):
    n1 = n2 = tmp = 1
    for _ in range(n - 1):
        tmp = n1 + n2
        n1, n2 = n2, tmp
    return tmp

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

Python: def fibonacci(f, n):
    if n == 0 or n == 1:
        f[n] = 1
        return f[n]
    if f[n]:
        return f[n]
    f[n] = fibonacci(f, n - 2) + fibonacci(f, n - 1)
    return f[n]

n = int(input())
f = [None for i in range(n + 1)]
print(fibonacci(f, n))

Python: import numpy as np
import sys
n  = 45
f = [-1 for i in range(45)]

def fib(n):
    global f

    if (n == 0):
        return 1
    elif (n == 1):
        return 1
    elif(f[n] == -1):
        f[n] = fib(n - 1) + fib(n - 2)

    return f[n]

if __name__ == "__main__":


    n = input("input number: ")
    n = int(n)
    #print(type(n))
    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())),end="")

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

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

def fib(n):
    if memo[n] != -1:
        return memo[n]
    else:
        ans = fib(n-1)+fib(n-2)
        memo[n] = ans
        return ans

print(fib(n))

Python: # -*- coding: utf-8 -*-
import functools


@functools.lru_cache(maxsize=None)
def fib(n):
    if n <= 1:
        return 1
    else:
        return fib(n - 1) + fib(n - 2)


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

Python: n=int(input())

a=[None] * (n+1)
a[0] = 1
a[1] = 1

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

print(a[n])

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