Submission
Status:
-PPPP-----
Subtask/Task Score:
40/100
Score: 40
User: limsan20122
Problemset: อนุกรม
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-29 21:54:06
#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;
int box[x]={0};
box[0]=1;
box[1]=1;
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-1];
return 0;
}