Pagini recente » Rk | Diferente pentru utilizator/apostoliliedaniel intre reviziile 47 si 16 | Ppal | Diferente pentru deque-si-aplicatii intre reviziile 114 si 142 | Cod sursa (job #2178743)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fcin("lgput.in");
ofstream fcout("lgput.out");
int power(int x, int y)
{
if (y == 0)
return 1;
int d = power(x, y / 2);
if (y % 2 == 0)
return d * d;
return x * d * d;
}
int main()
{
int N, P;
fcin >> N >> P;
fcout << power(N, P) % 1999999973;
}