Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: Karatat007

Problemset: อนุกรม

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-17 13:59:02

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

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

    int old = 1;
    int nw = 1;
    int n;
    cin >> n;
    for(int i = 1;i <= n - 2;++i){
        nw = old + nw;
        old = nw - old;
    }
    cout << nw;
}