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
}

C++: #include<iostream>
using namespace std;

int mem[50];

long long fib(int n){
  if(mem[n]!=-1)
    return mem[n];
  
  if(n==0||n==1)
    return mem[n]=1;

  return mem[n]=fib(n-1)+fib(n-2);
}

main()
{

  int n;
  
  cin >> n;
  
  for(int i=0;i<50;i++){
    mem[i]=-1;
  }

  cout << fib(n) << endl;

  return (0);
}

C++: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int MOD = 1000000009;
const long long INF = 1LL << 60;

int main() {
    int n;
    cin >> n;
    vector<ll> fib(n+1, 1);
    for (int i = 2; i <= n; ++i) {
        fib[i] = fib[i-1] + fib[i-2];
    }
    cout << fib[n] << endl;
    return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int fib[100];
int main(){
	int n;
	cin>>n;
	fib[0]=1;
	fib[1]=1;
	//fib[2]=1;
	for(int i =2;i <= n;i++){
		fib[i]=fib[i-1]+fib[i-2];
	}
	cout <<fib[n]<<endl;
	return 0;
}

C++:                                         #include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;


int gcd(int a,int b){
	if(a<b) return gcd(b,a);
	if(b==0) return a;
	if(a%b==0) return b;
	return gcd(b,a%b);
}
map<int,int>ma;
           signed main(){
               int n;
 // cin>>n;
         int f[100];
           	f[0]=1;
           	f[1]=1;
           	for(int  i=2;i<50;i++)f[i]=f[i-1]+f[i-2];
           	int u;
           	cin>>u;
           	
           	cout<<f[u]<<endl;
           }

C++: #include <iostream>
#include <map>

int rec_fibonacci(int n, std::map<int, int>* m) {
  if (n == 0 || n == 1)
    return 1;
  if (m->find(n) == m->end())
    (*m)[n] = rec_fibonacci(n-1, m) + rec_fibonacci(n-2, m);
  return (*m)[n];
}

int fibonacci(int n) {
  std::map<int, int> m;
  return rec_fibonacci(n, &m);
}

int main() {
  int n;
  std::cin >> n;
  std::cout << fibonacci(n) << std::endl;
}

C++: #include<iostream>
#include<vector>

using namespace std;
vector<int> fib(50);

int makefib(int n){
  if(n==0||n==1) return fib[n]=1;
  if(fib[n]!=-1) return fib[n];
  else return fib[n]=makefib(n-1)+makefib(n-2);
}
		  
int a;
int main(void){
  cin>>a;
  for (int i=0; i<50; i++) fib[i]=-1;
  cout<<makefib(a)<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int,int>P;
int dp[100];
int fibo(int x){
	if(x==0||x==1){return dp[x]=1;}
	if(dp[x]!=0){return dp[x];}  
  	return dp[x]=fibo(x-1)+fibo(x-2);
  
}
 


int main() {
 rep(i,100){dp[i]=0;}
  int n; cin>>n;
	cout<<fibo(n)<<endl;
  
  
}

C++: #include<iostream>

using namespace std;

long fivo(long a){
  if (a==1 or a==2) return 1L;

  else 
    
    return fivo(a-1)+fivo(a-2);
}




int main(){
  long n,req;
  
  cin >>req;
  n=fivo(req+1);
  //  for(n=1;n<=20;n++){
  //cout<<fivo(n)<<endl;
  // }
  cout <<n<<endl;
  return 0;
}