Pagini recente » Cod sursa (job #2358462) | Cod sursa (job #465700) | Cod sursa (job #1956125) | Cod sursa (job #414759) | Cod sursa (job #2998487)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(WHATEVER) for(int i = 1; i <= WHATEVER; ++ i)
/// INPUT / OUTPUT
const string problem = "lgput";
ifstream fin("lgput.in");
ofstream fout("lgput.out");
/// GLOBAL VARIABLES
const long long NMAX = 1, MOD = 1999999973, INF = 1e9;
long long n, p;
/// SOLUTION
inline ll lgput(long nr, long exp)
{
long long x = 1, y = nr;
while(exp)
{
if((exp & 1) == 1)
{
x = (x * y) % MOD;
x%=MOD;
}
y*=(y%MOD);
y%=MOD;
exp >>= 1;
}
return x;
}
/// READING THE INPUT
int main()
{
ios::sync_with_stdio(false);
fin.tie(NULL);
fout.tie(NULL);
fin >> n >> p;
fout << lgput(n, p);
}