Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: konthaina_TH
Problemset: Fibonacci Croissant
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-31 09:04:58
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
unsigned long long n,total = 1;
cin >> n;
unsigned long long num[n];
num[0] = 0;
num[1] = 1;
for (int i=0;i<n-1;i++) {
num[2+i] = num[i] + num[1+i];
total += num[2+i];
}
cout << total;
return 0;
}