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: target = int(input())
fib = [0 for n in range(target + 1)]
for i in range(target):
    if i == 0:
        continue
    elif i == 1:
        fib[i] = 1
    else:
        fib[i] = fib[i - 1] + fib[i - 2]
print(fib[target])

Python: MAXN = 45
fibs = [-1] * MAXN


def fib(n):
    """Returns n-th fibonacci number

    >>> fib(3)
    3
    >>> fib(10)
    89
    >>> fib(20)
    10946
    """
    if n == 0:
        return 1
    elif n == 1:
        return 1
    elif fibs[n] == -1: 
        fibs[n] = fib(n-1) + fib(n-2)

    return fibs[n]


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


if __name__ == '__main__':
    run()

Python: a=[0]*45
a[0]=1
a[1]=1

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

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

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

Python: import sys
if __name__ == "__main__":
    n = int(input())
    if n == 0 or n == 1:
        print(1)
        sys.exit(0)
    dp = [0] * (n + 1)
    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: # -*- coding: utf-8 -*-


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


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

Python: import sys
input = sys.stdin.readline
dp: list = [-1] * 50
def fib(n: int) -> int:
    if n == 0 or n == 1:
        dp[n] = 1
        return dp[n]
    elif dp[n] != -1:
        return dp[n]
    else:
        dp[n] = fib(n-1) + fib(n-2)
        return dp[n]

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

if __name__ == '__main__': main()

Python: import numpy as np
import sys

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

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

Python: def fib(n):
    global Fib
    if n <= 1:
        return 1
    elif Fib[n] != -1:
        return Fib[n]
    else:
        return fib(n-1) + fib(n-2)

def fib_eff(n):
    global Fib
    Fib[0] = 1
    Fib[1] = 1
    for i in range(2, n+1):
        Fib[i] = Fib[i-1] + Fib[i-2]

n = int(input())
Fib = [-1] * 45
fib_eff(n)
print(Fib[n])

Python: n = int(input())

if n == 0 or n == 1:
  print(1)
elif n == 2:
  print(2)
else:
  f = [1,1]
  for i in range(2, n+1):
    g = int(f[i-1]) + int(f[i-2])
    f.append(g)
  print(f.pop())

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

Python: ii = lambda : int(input())
n = ii()
w = [-1]*50
w[0] = 1
w[1] = 1
for i in range(2,45):
    w[i]=w[i-2] + w[i-1]
print(w[n])

Python: def fib(n):

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

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

if __name__ == "__main__":
    n = int(input())
    F = []
    for _ in range(n+1):
        F.append(None)
    fibonacci(F, n)
    print(F[n])

Python: def fib(n):
    global f
    if f[n]==False:
        val=fib(n-1)+fib(n-2)
        f[n]=val
        return val
    else:
        return f[n]


n=int(input())
N=44+1
f=[1,1]
f.extend([0]*N)
fib(N)
print(f[n])

Python: import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

N = int(input())

fib = [1]*50

for i in range(N+2):
    fib[i+2] = fib[i] + fib[i+1]

print(fib[i-1])

Python: # フィボナッチ数列

n = int(input())
F = [0] * (n + 1)


def fibonacci(n):
    global F
    if n == 0 or n == 1:
        F.append(1)
        F.append(1)
        return 1
    if F[n] != 0:
        return F[n]
    F[n] = fibonacci(n - 1) + fibonacci(n - 2)
    return F[n]


ans = fibonacci(n)
print(ans)

Python: f=[0]*45
f[0]=f[1]=1

def fib(n):
    if n ==0 or n==1:
        return 1
    else:
        if f[n] == 0:
            f[n] = fib(n-1)+fib(n-2)
            return f[n]
        else:
            return f[n-1]+f[n-2]
n = int(input())
print(fib(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()

dp=[0]*50
dp[0]=dp[1]=1
for i in range(2, 50):
    dp[i]=dp[i-1]+dp[i-2]

print(dp[N])

Python: def fib(n):
    if n == 0 or n == 1:
        return 1
    if A[n] is not None:
        return A[n]
    A[n] = fib(n - 1) + fib(n - 2)
    return A[n]


A = [None] * (44 + 1)
n = int(input())
print(fib(n))

Python: n = int(input())

dp = [-1] * (n+1)

# def fibonacci(n):
#     if n==0 or n==1:
#         dp[n] = 1
#         return dp[n]
#     else:
#         if dp[n]!=-1:
#             return dp[n]
#         else:
#             dp[n] = fibonacci(n-1) + fibonacci(n-2)
#             return dp[n]

# ans = fibonacci(n)
# print(ans)

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: # https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/10/ALDS1_10_A
# やるだけ


n = int(input())
# dpテーブルの用意
dp = [-1]*(n+1)
# dpの初期値
dp[0], dp[1] = 1, 1

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

Python: n = int(input())

first = 1
second = 1
for i in range(n):
    second, first = first + second, second
return val