Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: punzacp555
Problemset: อนุกรม
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-02 21:04:47
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
vector<long long> dp(n);
dp[0] = dp[1] = 1;
for(int i=2; i<n; i++) {
dp[i] = dp[i-1] + dp[i-2];
}
cout << dp[n-1];
return 0;
}