Pagini recente » Cod sursa (job #146619) | Cod sursa (job #2701643)
#include <bits/stdc++.h>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
// #define f cin
// #define g cout
const int mod = 1999999973;
int lgput(int a, int b)
{
a %= mod;
b %= mod - 1;
int p = 1;
while (b)
{
if (b & 1)
p = (1ll * p * a) % mod;
a = (1ll * a * a) % mod;
b >>= 1;
}
return p;
}
int main()
{
ios_base::sync_with_stdio(false);
f.tie(nullptr);
g.tie(nullptr);
int q = 1;
for (int a, b; q; q--)
f >> a >> b,
g << lgput(a, b);
return 0;
}