Cod sursa(job #2738196)

Utilizator MocalinnoMoca Andrei Catalin Mocalinno Data 5 aprilie 2021 15:52:44
Problema Al k-lea termen Fibonacci Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <bits/stdc++.h>
using namespace std;
void DAU(const string& task = "") {
    if (!task.empty())
        freopen((task + ".in").c_str(), "r", stdin),
        freopen((task + ".out").c_str(), "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}
void PLEC() {
    exit(0);
}
int x, y(1), z, k;
signed main() {
    DAU("kfib");
    cin >> k;
    while (k-- % 1332028) {
        z = (x + y) % 666013;
        x = y, y = z;
    }
    cout << x;
    PLEC();
}