Pagini recente » Diferente pentru problema/algoritm intre reviziile 6 si 5 | Cod sursa (job #1870312) | Cod sursa (job #1864820) | Cod sursa (job #520036) | Cod sursa (job #1861249)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long s = 1;
int n, p;
void Rezolva()
{
fin >> n >> p;
int k = 1999999973;
while(p > 0)
{
if(p % 2 == 1)
{
s = (1LL * s * n) % k;
p--;
}
p /= 2;
n = (1LL * n * n) % k;
}
fout << s << "\n";
}
int main()
{
Rezolva();
return 0;
}