Pagini recente » Istoria paginii utilizator/the_andy | Atasamentele paginii Elicop | Cod sursa (job #1416594) | Diferente pentru problema/stiva4 intre reviziile 2 si 1 | Cod sursa (job #1416589)
#include <fstream>
#define rest 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int pow(int x, int n)
{
int p = 1;
while(n > 0)
{
if(n&1)
{
p *= x;
n--;
}
x = x * x;
n >>= 1;
}
return p;
}
int main()
{
int n, x ,rez;
fin >> n >> x;
rez = pow(n,x);
fout << rez%rest;
return 0;
}