Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: tull
Problemset: Fibonacci Croissant
Language: cpp
Time: 0.002 second
Submitted On: 2026-06-01 01:00:50
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define bp '\n'
#define ld long double
#define vp cout<<'\n';
#define all(A) A.begin(),A.end()
using pii=pair<int,int>;
const int MOD=1e9+7;
const int MNLL=-1e18;
const int MXLL=1e18;
const int N=2e5+10;
const string sans[]={"no","yes"};
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int n;
int l=0,r=1,sum=1,x;
cin>>n;
for(int i=2;i<=n;++i){
x=l+r;
sum+=x;
l=r;
r=x;
}
cout<<sum;
}