Pagini recente » Cod sursa (job #2401164) | Cod sursa (job #1281779) | Cod sursa (job #1243181) | Cod sursa (job #1145555) | Cod sursa (job #736524)
Cod sursa(job #736524)
#include <fstream>
#include <cstdlib>
using namespace std;
const int MODULO=1999999973;
inline int pow(int x, int n)
{
int r;
for(r=1; n; n>>=1)
{
if(n&1)
r=(1LL*r*x)%MODULO;
x=(1LL*x*x)%MODULO;
}
return r;
}
int main()
{
int x, n;
ifstream in("lgput.in");
ofstream out("lgput.out");
in>>x>>n;
out<<pow(x, n)<<'\n';
return EXIT_SUCCESS;
}