Pagini recente » Diferente pentru problema/fibo4 intre reviziile 1 si 2 | Cod sursa (job #2070913) | Cod sursa (job #1132776) | Cod sursa (job #1132789) | Cod sursa (job #2335895)
#include <fstream>
#include <iostream>
#define NMAX 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long long power(long long x,long y){
if(y==0)
return 1;
if(y==1)
return x;
if(y%2==0)
return power(x*x,y/2);
return x*power(x*x,y/2);
}
int main(){
long long x;
long long y;
f>>x>>y;
g<<power(x,y)%NMAX;
}