Pagini recente » Cod sursa (job #519259) | Cod sursa (job #2398390) | Cod sursa (job #2314973) | Cod sursa (job #2398462) | Cod sursa (job #1919767)
#include <iostream>
#include <fstream>
#define MOD 1999999973;
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
long long base,exp;
long long LogExp(long long base,long long exp)
{
long long act=base,out=1;
for(long long p=1;p<=exp;p<<=1)
{
if(p&exp)
out=(out*act)%MOD;
act=(act*act)%MOD;
}
return out;
}
int main()
{
in>>base>>exp;
out<<LogExp(base,exp);
return 0;
}