Pagini recente » Diferente pentru problema/babacu intre reviziile 9 si 8 | Cod sursa (job #1212312) | Cod sursa (job #1222856) | Cod sursa (job #2694405) | Cod sursa (job #2938479)
#include<bits/stdc++.h>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int n,p;
int putere(int n,int p)
{
if(p==0) return 1;
else if(p==1) return n%1999999973;
else {int a=putere(n,p/2);
if(n%2==0) return (a*a)%1999999973;
else return ((a*a)%1999999973*n)%1999999973;
}
}
int main()
{in>>n>>p;
out<<putere(n,p);
return 0;
}