Submission

Status:

---PPPPxxx

Subtask/Task Score:

40/100

Score: 40

User: limsan20122

Problemset: อนุกรม

Language: cpp

Time: 0.003 second

Submitted On: 2025-09-29 21:50:30

#include <iostream>
#include <vector>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x=0;
    int y=0;
    cin >> x;
    unsigned long long int box[x]={0};
    box[0]=1;
    box[1]=2;
    if(x==1) cout << "1";
    else if(x==2) cout << "1";
    else{
        for(int i=0;i<x;i++){
            if((i+2)!=x){
                box[i+2]=box[i]+box[i+1];
            }
        }
    }
    cout << box[x-2];
    return 0;
}