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: import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect

# from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

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

print(d[n])

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: 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: def fibonacci(n, memo=None):
    if memo==None:
        memo = [None]*n
    if n<=1:
        return 1 
    else:
        if memo[n-2]==None:
            memo[n-2] = fibonacci(n-2, memo)
        if memo[n-1]==None:
            memo[n-1] = fibonacci(n-1, memo)
    return memo[n-1] + memo[n-2]

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

Python: 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: # Dynamic Programming - Fibonacci Number
memo = [0]*45
for i in range(45):
    if i == 0 or i == 1:
        memo[i] = 1
    else:
        memo[i] = memo[i-1] + memo[i-2]
print(memo[int(input())])

Python: 

def fibonacciDP(i):
    if i == 0:
        return 1
    elif i == 1:
        return 1
    else:
        if dp[i-1] is None and dp[i-2] is None:
            dp[i-1] = fibonacciDP(i-1)
            dp[i-2] = fibonacciDP(i-2)
        elif dp[i-1] is None:
            dp[i-1] = fibonacciDP(i-1)
        elif dp[i-2] is None:
            dp[i-2] = fibonacciDP(i-2)

        return dp[i-1]+ dp[i-2]

def fibonacci(i):
    if i == 0:
        return 1
    elif i == 1:
        return 1
    else:
        return fibonacci(i-1)+fibonacci(i-2)



n = int(input())
dp = [None]*n

print(fibonacciDP(n))

Python: n = int(input())
fib = [-1] * (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[-1])

Python: n = int(input())
dp = [1] * (n+1)

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

Python: n = int(input())

fib = [1]*(n+1)

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

Python: def fib(n):
    x=[1,1]
    for i in range(n+1):
        y=x[i]+x[i+1]
        x.append(y)
    print(x[n])
    
a=int(input())
fib(a)

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

Python: 
n=int(input())
f=[0]*45
def Fib(n):
    if n==0:
        return 1
    elif n==1:
        return 1
    else:
        if f[n]!=0:
            return f[n]
        else:
            f[n]=Fib(n-1)+Fib(n-2)
            return f[n]
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())))

Python: y=[1,1]
n=int(input())
for i in range(0,n):
    a=y[i]+y[i+1]
    y.append(a)
print(y[n])

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

Python: memo = {} #メモ化されないと時間がかかる
def fib(n):
  if n == 0 or n == 1:
    return 1
  # else:
  #   return fib(n-1) + fib(n-2)
  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]
print(fib(int(input())))

Python: #Fibonacci Number
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=jp


class fibonacci:
    def __init__(self):
        self.result: List[int] = [-1]*1000
        return 
    def calc(self,n):
        if (n == 0 or n == 1):
            self.result[n] = 1
            return 1
        if (self.result[n] != -1):
            return self.result[n]
        self.result[n-1] = self.calc(n-1) 
        self.result[n-2] = self.calc(n-2)
        return self.result[n-1] + self.result[n-2]
n = int(input())

print (fibonacci().calc(n))

Python: ####
n = int(input())
memo = [-1]*(n+10)
def fib(i):
    if i==0 or i == 1:
        return 1
    if memo[i] != -1:
        return memo[i]
    memo[i] = fib(i-1) + fib(i-2)
    return memo[i]
print(fib(n))

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

Python: N = int(input())
dp = [None] * (N + 1)

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

print(fib(N))

Python: from functools import lru_cache

n = int(input())


@lru_cache(maxsize=None)
def rec(n):
    if n <= 1:
        return 1
    else:
        return rec(n - 1) + rec(n - 2)


print(rec(n))