Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Quinruj
Problemset: อนุกรม
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-02 16:41:04
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;cin>>n;
ll a = 1;
ll b = 1;
if (n <= 2){
cout << 1;
return 0;
}
n-=2;
while (n--){
ll temp = a+b;
a = b;
b = temp;
}
cout << b;
}