Pagini recente » Cod sursa (job #208865) | Cod sursa (job #2824413) | Cod sursa (job #2125749) | Cod sursa (job #485419) | Cod sursa (job #2720957)
#include <bits/stdc++.h>
#define mod 1999999973;
using namespace std;
int lgput(int base, int exponent){
if(exponent == 0) return 1;
if(exponent == 1) return base;
if(exponent % 2 == 0) return (1LL * lgput(base, exponent / 2) * lgput(base, exponent / 2)) % mod;
return (1LL * base * lgput(base, exponent / 2) * lgput(base, exponent / 2)) % mod;
}
int main(){
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int x, pow;
fin >> x >> pow;
fout << lgput(x, pow);
return 0;
}