Pagini recente » Cod sursa (job #1546803) | Diferente pentru problema/kdrum intre reviziile 20 si 10 | Cod sursa (job #2782517) | Diferente pentru problema/s013 intre reviziile 9 si 10 | Cod sursa (job #1000379)
#include <fstream>
#define nmax 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long long n, p, x, y;
int main ()
{
f >> n >> p;
x = 1;
y = n%nmax;
while(p > 0)
if(p%2 == 0)
{
y = (y*y)%nmax;
p /= 2;
}
else
{
x = (x*y)%nmax;
p --;
}
g << x%nmax;
return 0;
}