Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: patsa_v

Problemset: อนุกรม

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-06 09:42:50

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<long long int> dp(n+5,0);
    dp[0] = 1;
    dp[1] = 1;

    for(int i=2;i<=n;i++){
        dp[i] = dp[i-1] + dp[i-2];
    }

    cout << dp[n-1];
    

    return 0;
}