Pagini recente » Cod sursa (job #3182546) | Cod sursa (job #3284717)
#include <bits/stdc++.h>
#define MOD 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int a, b;
int Expolog(int a, int n, int mod)
{
int p = 1;
while (n > 0)
{
if (n % 2 == 1) p = 1LL * p * a % mod;
a =1LL * a * a % mod;
n /= 2;
}
return p;
}
int main()
{
fin >> a >> b;
fout << Expolog(a, b, MOD);
return 0;
}
//0 1 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 21 22 24 25 26 27 29 30 34 35 36 42 44 45 47 48 51 54 56 57 58