Pagini recente » Cod sursa (job #3271148) | Cod sursa (job #244215) | Cod sursa (job #512254) | Cod sursa (job #478473) | Cod sursa (job #2998485)
#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 int NMAX = 1, MOD = 1999999973, INF = 1e9;
int n, p;
/// SOLUTION
inline ll lgput(int nr, int exp)
{
int x = 1, y = nr;
while(exp)
{
if((exp & 1) == 1)
{
x = (x * y) % MOD;
}
y*=(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);
}