Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: kavin8888
Problemset: Fibonacci Croissant
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-22 17:50:33
#include<bits/stdc++.h>
using namespace std;
#define spps1 ios::sync_with_stdio(false)
#define spps2 cin.tie(nullptr)
#define ll unsigned long long
vector<ll> memo(101,-1);
ll fibo(int n)
{
if(memo[n] != -1)
return memo[n];
if(n==1) return memo[n]=1;
if(n==2) return memo[n]=2;
memo[n]=fibo(n-1)+fibo(n-2);
return memo[n];
}
int main()
{
spps1; spps2;
int n; cin>>n;
cout<<fibo(n+1)-1<<'\n';
return 0;
}