Submission
Status:
----------
Subtask/Task Score:
0/100
Score: 0
User: cyblox_boi
Problemset: Croissant Express
Language: cpp
Time: 0.003 second
Submitted On: 2026-01-01 02:00:25
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
long long f0 = 0, f1 = 1;
long long sum = f0 + f1;
if (n == 0)
{
cout << 0 << '\n';
return 0;
}
for (int i = 2; i <= n; i++)
{
long long f2 = f0 + f1;
sum += f2;
f0 = f1;
f1 = f2;
}
cout << sum << '\n';
return 0;
}