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: A = [None] * (44 + 1)
A[0] = 1
A[1] = 1


def fibonacci(n: int) -> int:
	if A[n] == None:
		A[n] = fibonacci(n - 1) + fibonacci(n - 2)
	return A[n]


if __name__ == "__main__":
	n = int(input())
	print(fibonacci(n))

Python: n = int(input())

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

print(fib[n])

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

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

Python: def fibonacci(N, dp):
    if dp[N] != 0:
        return dp[N]
    if N == 1 or N == 0:
        dp[N] = 1
    else:
        dp[N] = fibonacci(N - 1, dp) + fibonacci(N - 2, dp)
    return dp[N]


def main():
    N = int(input())
    dp = [0] * (N + 1)
    print(fibonacci(N, dp))


if __name__ == '__main__':
    main()

Python: MAX_N = 44
dp = [None] * (MAX_N + 1)
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]

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

Python: def fib(n):
    nums = []
    for i in range(n+1):
        if i <= 1:
            nums.append(1)
        else:
            nums.append(nums[i-1]+nums[i-2])
    return nums[n]


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


if __name__ == "__main__":
    main()

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

Python: N_MAX = 45 # 0 ≤ n ≤ 44
F = [None] * N_MAX


def fibonacci(n):
    if n == 0 or n == 1:
        F[n] = 1
        return F[n]

    if F[n] != None:
        return F[n]

    F[n] = fibonacci(n - 1) + fibonacci(n - 2)

    return F[n]



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

Python: n = int(input())
L = [-1]*(n+1)
def fib(i,L):
    if i <= 1:
        return 1
    else:
        if L[i] != -1:
            return L[i]
        else:
            L[i] = fib(i-1,L)+fib(i-2,L)
            return L[i]
        return fib(i-1,L)+fib(i-2,L)
print(fib(n,L))

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

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

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

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

Python: import sys
input = sys.stdin.readline

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

print(F[n])

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

Python: n = int(input())

cache = {0: 1, 1: 1}
def fibonacci(n):
    if cache.get(n, None) is not None:
        return cache[n]
    cache[n] = fibonacci(n-1) + fibonacci(n-2)
    return cache[n]

print(fibonacci(n))

Python: fib=[0]*45
fib[0]=1
fib[1]=1
for i in range(2,45):
    fib[i]=fib[i-1]+fib[i-2]

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

Python: def memoize(f):  
    cache = {}  
    def helper(x):  
        if x not in cache:              
            cache[x] = f(x)  
        return cache[x]  
    return helper 
        
@memoize
def fib(n):
    if n in (0, 1):
        return 1
    else:
        return fib(n - 1) + fib(n - 2)

pritn(fib(int(input())))

Python: from collections import deque
from enum import Enum
import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

table = [0] * 45

table[0] = 1
table[1] = 1

N = int(input())

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


print("%d"%(table[N]))

Python: n=int(input())
a=list(range(n+1))
a[0]=1
i=2
while i<=n:
    a[i]=a[i-1]+a[i-2]
    i+=1
print(a[n])

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

Python: import sys
input = sys.stdin.readline

def fib2(n):
    n0,n1 = 1,1
    ans = 1
    for i in range(2,n+1):
        n0,n1 = n1,ans
        ans = n0 + n1
    return ans

if __name__ == "__main__":
    n = int(input())
    print(fib2(n))

Python: 
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))

Python: p = int(input())
def fib(n):
    dp = [0] * 50
    for i in range(n+1):
        if i == 0 or i == 1:
            dp[i] = 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
    return dp[n]
print(fib(p))

Python: # -*- coding: utf-8 -*-
# 標準入力を取得
n = int(input())

# 求解処理
# dp[i+1]: フィボナッチ数列の第i項
dp = [0 for _ in range(n + 1)]

# 初期条件
dp[0] = 1
dp[1] = 1

for i in range(1, n):
    # DP漸化式
    dp[i + 1] = dp[i] + dp[i - 1]
ans = dp[n]

# 結果出力
print(ans)

Python: # coding: utf-8
# Your code here!

def fibo(n):
    if n==0:
        return 1
    if n==1:
        return 1
    if memo[n] != 0:
        return memo[n]
    memo[n]=fibo(n-1)+fibo(n-2)
    return memo[n]
n=int(input())
memo=[0 for i in range(n+1)]

print(fibo(n))

Python: memo = {}

def fib(n) :
    if n in memo.keys() :
        return memo[n]
    else :
        if n == 0 :
            return 1
        elif n == 1 :
            return 1 
        else :
            memo[n] = fib(n - 1) + fib(n - 2)
            return memo[n]
    
print(fib(int(input())))

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

Python: n = int(input())

def fib(n):
 if(n==0): return 1
 elif(n==1): return 1
 elif(n>1):
   a,b = 1,1
   for i in range(n-1):
     a,b = b,a+b
   return b

print(fib(n))

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