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: if __name__ == '__main__':
    n = int(input())
    ans = [1, 1, ]
    if n == 0 or n == 1:
        print(ans[n])
    else:
        for i in range(2, n + 1):
            ans.append(ans[i - 2] + ans[i - 1])
        print(ans[n])

Python: def fib(n):
    def iter(a, b, cnt):
        if cnt == 0:
            return a
        return iter(b, a+b, cnt-1)
    return iter(1, 1, n)

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

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

Python: 
fibo = [0] * 45
N = int(input())
fibo[0] = 1
fibo[1] = 1

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

print(fibo[N])
# N = int(input())　再帰のみ
# def fibo(n):
#     if n == 0 or n == 1:
#         return 1
#     return fibo(n-1)+fibo(n-2)
# print(fibo(N))
# N = int(input()) メモ化再帰　5596KB 635B
# def fibo(n):
#     return fib2(1,1,n-1)
# def fib2(a,b,c):
#     if c < 1:
#         return a
#     return fib2(a+b,a,c-1)
# print(fibo(N))

Python: N = int(input())
a = 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):
    a = fib[i-1] + fib[i-2]
    fib.append(a)

print(fib[n])

Python: memo = [1, 1]

def fib(n):
    if (n < len(memo)):
        return memo[n]

    memo.append(fib(n-1) + fib(n-2))
    return memo[n]

N = int(input())
print(fib(N))

Python: import sys
m = int(input())
f = [0]*50
def fib(n):
  if n==0 or n==1:
    f[n] == 1
    return 1
  if f[n]!=0:
    return f[n]
  f[n] = fib(n-2) + fib(n-1)
  return f[n]

print(fib(m))

Python: n = int(input())

dp = [-1] * 100
dp[0] = 1
dp[1] = 1


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


if __name__ == "__main__":
    print(fib(n))

Python: #!/usr/bin/python3

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

Python: # coding=utf-8


def fib(number):
    if number == 0 or number == 1:
        return 1
    memo1 = 1
    memo2 = 1

    for i in range(number-1):
        memo1, memo2 = memo1+memo2, memo1
    return memo1


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

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

Python: def main():
    import sys
    input=sys.stdin.readline

    n=int(input())
    if n==0 or n==1:
      print(1)
      return 
      
    dp=[0]*(1+n)
    dp[0]=1
    dp[1]=1
    for i in range(n-1):
        dp[i+2]=dp[i+1]+dp[i]
    
    print(dp[-1])   
 
if __name__=='__main__':
    main()

Python: def fibonacci(n):
    if n <= 1:
        return 1
    fib_array = [1] * 45

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

def main():
    n = int(input())
    fib = fibonacci(n)
    print(fib)
    return


main()

Python: n = int(input())
from functools import lru_cache
@lru_cache(maxsize=None)
def fib(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fib(n-2)+fib(n-1)
print(fib(n))

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

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

def solve(N):
    fib = [1]*(N+1)
    for i in range(2,N+1):
        fib[i] = fib[i-1] + fib[i-2]
    ans = fib[N]
    return ans
print(solve(N))

Python: n = int(input())


def memoize(f):
    memo = [1, 1] + [0] * max(0, n - 1)

    def main(i):
        if memo[i]:
            return memo[i]
        result = memo[i] = f(i)
        return result

    return main


@memoize
def fibonacci(i):
    return fibonacci(i - 1) + fibonacci(i - 2)


print(fibonacci(n))

Python: n = input()

if n == 0:
    print(1)
elif n == 1:
    print(1)
else:
    fib = [0 for i in range(n + 1)]

    fib[0] = 1
    fib[1] = 1

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

    print(fib[n])

Python: n = int(input())

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

print(f[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: # -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N=INT()

memo=[0]*50
memo[0]=memo[1]=1
def rec(n):
    if memo[n]:
        return memo[n]
    memo[n]=rec(n-1)+rec(n-2)
    return memo[n]

print(rec(N))

Python: def power(base,exp,op=lambda x,y:x*y,ie=1):
    res = ie
    while exp:
        if exp & 1:
            res = op(res,base)
        base = op(base,base)
        exp >>= 1
    return res

def fibonacci(n):
    I = [1,0,0,1]
    A = [1,1,1,0]
    mmul = lambda P,Q: [P[0]*Q[0]+P[1]*Q[2],P[0]*Q[1]+P[1]*Q[3],P[2]*Q[0]+P[3]*Q[2],P[2]*Q[1]+P[3]*Q[3]]
    return power(A,n+1,mmul,I)[2]

print(fibonacci(int(input())))

Python: # フィボナッチ数列 Fibonacci number

DP = [-1 for i in range(45)]
DP[0] = 1
DP[1] = 1

def fib(i):
    if DP[i] != -1:
        return DP[i]
    else:
        DP[i] = fib(i-1) + fib(i-2)
        return DP[i]

n = int(input())
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())))