Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: Quinruj

Problemset: อนุกรม

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-02 16:38:55

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;cin>>n;
    int a = 1;
    int b = 1;
    if (n <= 2){
        cout << 1;
        return 0;
    }
    n-=2;
    while (n--){
        int temp = a+b;
        a = b;
        b = temp;
    }
    cout << b;
}