Pagini recente » Cod sursa (job #1936900) | Cod sursa (job #1771890) | Diferente pentru problema/keymess intre reviziile 41 si 42 | Diferente pentru problema/robot1 intre reviziile 11 si 4 | Cod sursa (job #473278)
Cod sursa(job #473278)
#include <fstream>
using namespace std;
const int mod=1999999973;
ifstream in("lgput.in");
ofstream out("lgput.out");
long long power(long long x,long long n)
{
if (!n || x==1)
return 1;
if (n==1)
return x%mod;
return (power((x*x)%mod,n/2)*power(x,n&1))%mod;
}
int main()
{
int n,p;
in>>n>>p;
out<<power(n,p)<<"\n";
return 0;
}