Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: อนุกรม
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-07 15:21:34
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
vector<long long> a(n+1);
a[0] = 0; a[1] = 1; a[2] = 1;
for(int i = 3; i <= n; i++) {
a[i] = a[i-1] + a[i-2];
}
cout << a[n];
}