Cod sursa(job #940528)
Utilizator | Data | 16 aprilie 2013 15:45:44 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main ()
{
unsigned long long x, y , c = 1999999973ll, i, temp = 1ll, rez = 1ll;
fin>>x>>y;
temp = x;
while(y!=0ll)
{
if(y % 2ll != 0)
rez = (rez * temp) % c;
temp = (temp * temp) % c;
y /= 2ll;
}
fout<<rez;
return 0;
}