Cod sursa(job #2701422)
Utilizator | Data | 31 ianuarie 2021 04:34:02 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include <iostream>
#include <math.h>
#include <fstream>
using namespace std;
ifstream f("kfib.in");
ofstream g("kfib.out");
int main()
{
double gr = (1 + sqrt(5))/2;
unsigned long long n,x;
f>>n;
x=((pow(gr, n) - pow(1 - gr, n))/sqrt(5));
x=x%666013;
g<<x;
return 0;
}