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: def fibo(n):
	S=[1,1]
	s=1
	if n>1:
		for i in range(2,n+1):
			S.append(S[i-1]+S[i-2])
			s=S[i]
	return s

def main():
	if __name__=="__main__":
		n=input()
		print(fibo(n))

main()

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

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

Python: from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    dp=[0]*(n+1)
    for i in range(n+1):
        if i==0 or i==1:
            dp[i]=1
        else:
            dp[i]=dp[i-1]+dp[i-2]

    print(dp[n])
    
if __name__=="__main__":
    main()

Python: from functools import lru_cache
counter = 0
@lru_cache(maxsize=1024)

def fib(n):
    global counter
    counter += 1
    if n in [0, 1]:
        return 1
    return fib(n - 1) + fib(n - 2)

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

Python: def g(a,b,n):
    if n==0 or n==1: return a
    else: return g(a+b,a,n-1)
a,b=1,1
print(g(a,b,int(input())))

Python: N = int(input())

memolist = [-1]*(N+1)
def fib(x):
    if memolist[x] == -1:
        if x == 0 or x == 1:
            memolist[x] = 1
        else:
            memolist[x] = fib(x - 1) + fib(x - 2)
    return memolist[x]

print(fib(N))

Python: #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def fibo(n):
    a, b = 1, 1
    while n:
        a, b = b, a + b
        n -= 1
    return a


print(fibo(int(stdin.readline())))

Python: n = int(input())


F = [0] * (n + 1)

F[0] = 1
F[1] = 1

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

print(F[n])

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 and n != 1:
    fibo_list = []
    fibo_list.append(n - 1)
    fibo_list.append(n - 2)
    fib(n - 1, n - 2, fibo_list)
else:
    print(1)

Python: class Fib():
    f = [1] * 50
    def fib(self, n):
        for i in range(2, n + 1):
            self.f[i] = self.f[i - 1] + self.f[i - 2]
        return(self.f[n])

x = Fib()
print(x.fib(int(input())))

Python: # -*- coding: utf_8 -*-

n = int(input()) + 1
arr = [-1] * n

arr[0] = 1
arr[1] = 1

for i in range(2, len(arr)):
    arr[i] = arr[i - 1] + arr[i - 2]

print(arr[n - 1])

Python: import sys
sys.setrecursionlimit(10**7)

# n = int(input())
# a, b = map(int, input().split())
# int_list = list(map(int, input().split()))
# l = list(input().split())

mem = {}

def fib(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    if n not in mem.keys():
        res = fib(n-1) + fib(n-2)
        mem[n] = res
        return res
    else:
        return mem[n]

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

solve()

Python: n=int(input())
a=1
b=1
i=0
while i<n:
    a,b=b,a+b
    i+=1
print(a)

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

Python: 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)

N = int(input())
print(fib_memo(N))

Python: def main():
    N = int(input())
    if N <= 1:
        print(1)
        return
    fib = [0]*(N+1)
    fib[0], fib[1] = 1, 1
    for i in range(2, N+1):
        fib[i] = fib[i-1] + fib[i-2]
    print(fib[N])


if __name__ == "__main__":
    main()

Python: n=int(input())
a=[]
a.append(1)
a.append(1)

mamo =[-1]*100

for i in range(2,n+1):
	a.append(a[i-1]+a[i-2])
	i+=1
	# if mamo[i]!=-1
	

print(a[n])

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

Python: def fib(n):
    F = {0:1, 1:1}
    def fibonacci(n):
        ans = F.get(n,-1)
        if ans > 0: return ans
        F[n] = fibonacci(n-1) + fibonacci(n-2)
        return F[n]
    return fibonacci(n)
        
if __name__=='__main__':
    print(fib(int(input())))

Python: n = int(input().strip())
if n <= 1:
    print(1)
    raise SystemExit
prev1 = 1
prev2 = 1
for i in range(2, n+1):
    fib = prev2 + prev1
    prev2, prev1 = prev1, fib
print(fib)

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

Python: def fib2(n):
    a1, a2 = 1, 0
    while n > 0:
        a1, a2 = a1 + a2, a1
        n -= 1
    return a1


n = int(input())

print(fib2(n))

Python: class Fibonacci(object):
    memo = [1, 1]

    def get_nth(self, n):
        if n < len(Fibonacci.memo):
            return Fibonacci.memo[n]
        # print('fib({0}) not found'.format(n))
        for i in range(len(Fibonacci.memo), n+1):
            result = Fibonacci.memo[i-1] + Fibonacci.memo[i-2]
            Fibonacci.memo.append(result)
            # print('fib({0})={1} append'.format(i, result))
        return Fibonacci.memo[n]


if __name__ == '__main__':
    # ??????????????\???
    num = int(input())

    # ?????£??????????????°????¨????
    f = Fibonacci()
    result = f.get_nth(num)

    # ???????????????
    print('{0}'.format(result))

Python: def fib(n):
    if n==0 or n==1:
        return 1
    else:
        if f[n]!=0:
            return f[n]
        else:
            f[n]=fib(n-1)+fib(n-2)
            return f[n]
f=[0]*45
n=int(input())

print(fib(n))

Python: n = int(input())

memo = [0 for _ in range(45)]

def fib_memo(n):
    if memo[n] != 0:
        return memo[n]
    elif (n == 0) or (n == 1):
        return 1
    else:
        memo[n] = fib_memo(n-1) + fib_memo(n-2)
        return memo[n]
    
print(fib_memo(n))