Pagini recente » Cod sursa (job #2238436) | Cod sursa (job #1876216) | Cod sursa (job #961907) | Cod sursa (job #2585584) | Cod sursa (job #2132549)
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
const long long mod = 1999999973;
ifstream f("lgput.in");
ofstream g("lgput.out");
void putere(int n,int p)
{
long long int r = 1;
while(p != 0)
{
if(p % 2 == 1)
r = (1LL * r * n) % mod;
n = (1LL * n * n) % mod;
p/=2;
}
g<<r;
}
int main()
{
int n,p;
f>>n>>p;
putere(n,p);
return 0;
}