Pagini recente » Cod sursa (job #2664041) | Cod sursa (job #135105) | Cod sursa (job #1328274) | Cod sursa (job #1542413) | Cod sursa (job #1357809)
#include <fstream>
#define mod 1999999973
#define ll long long
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll put(ll x, ll y)
{
if (x == 0) return 0;
if (y == 0) return 1;
ll rez;
rez = put(x, y >> 1);
if (y % 2) return (((rez * rez) % mod) * x) % mod;
return (rez * rez) % mod;
}
int main()
{
ll n, p;
fin >> n >> p;
fout << put(n, p) << '\n';
return 0;
}