Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

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

Python: #!/usr/bin/python

n = int(input())

def fib(n):
    l = [0] * (n+1)
    l[0] = 1
    l[1] = 1

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

    return l[i]

print(fib(n))

Python: def fibonacci(n):
    num1 = 1
    num2 = 1
    tmp = 1

    for i in range(1, n):
        tmp = num1 + num2
        num1 = num2
        num2 = tmp

    return tmp


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

Python: n=int(input())

dp=[1,1]
def fib(n):
    if n==0 and n==1:
        return dp[n]
    for i in range(2,n+1):
        dp.append(dp[i-1]+dp[i-2])
    return dp[n]
print(fib(n))

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: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

# https://qiita.com/e869120/items/eb50fdaece12be418faa
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja


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


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


if __name__ == '__main__':
    main()

Python: def fib(n, fib_memo=None):                                                                                                                                                    
    if fib_memo == None:                                                                                                                                                      
        fib_memo = [None]*n                                                                                                                                                   
    if n <= 1:                                                                                                                                                                
        return 1                                                                                                                                                              
    else:                                                                                                                                                                     
        if fib_memo[n-1] == None:                                                                                                                                             
            fib_memo[n-1] = fib(n-1, fib_memo)                                                                                                                                
        if fib_memo[n-2] == None:                                                                                                                                             
            fib_memo[n-2] = fib(n-2, fib_memo)                                                                                                                                
        return fib_memo[n-1] + fib_memo[n-2]                                                                                                                                  
                                                                                                                                                                              
                                                                                                                                                                              
if __name__ == '__main__':                                                                                                                                                    
    n = input()                                                                                                                                                               
    print(fib(int(n)))

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

Python: N = int(input())

dp = [1] * (N + 1)

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

print(dp[N])

Python: _fib = [1, 1]

def fib(n):
    if len(_fib) > n:
        return _fib[n]
    else:
        _fib[n] = fib[n-1] + fib[n-2]
        return _fib[n]

_n = int(raw_input())
print(fib(_n))

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

Python: n=int(input())

fib=[0]*(n+1)
fib[0]=1
fib[1]=1

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

Python: # -*- coding: utf-8 -*-
 
 
def main(n):
    lst = []
    lst.append(1)
    lst.append(1)
    for i in range(2, n + 1):
        lst[i] = lst[i - 1] + lst[i - 2]
    return lst[n]
 

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

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

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

Python: F =[1,1] + [0 for i in range(44)]

n = int(input())

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

print(F[n])

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

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

Python: n = int(input())

dp = [0] * (n+10)
dp[0] = 1
dp[1] = 1

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

print(dp[n])