Pagini recente » Cod sursa (job #2923272) | Cod sursa (job #2403415) | Cod sursa (job #439215) | Cod sursa (job #1329793) | Cod sursa (job #2998488)
#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(problem + ".in");
ofstream fout(problem + ".out");
/// GLOBAL VARIABLES
const ll NMAX = 1, MOD = 1999999973, INF = 1e9;
ll n, p;
/// SOLUTION
inline ll lgput(ll num, ll exp)
{
ll ans = 1, x = num;
while(exp)
{
if(exp & 1 == 1)
{
ans = (x * ans) % MOD;
}
x = (x * x) % MOD;
exp >>= 1;
}
return ans;
}
/// READING THE INPUT
int main()
{
ios::sync_with_stdio(false);
fin.tie(NULL);
fout.tie(NULL);
fin >> n >> p;
fout << lgput(n, p);
}