Pagini recente » Cod sursa (job #2572326) | Cod sursa (job #2511803) | Diferente pentru dinic intre reviziile 31 si 30 | Cod sursa (job #1624763) | Cod sursa (job #3135776)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int mod = 1999999973;
int lgput(int x, int n){
if(n == 0){
return 1;
}
else if(n % 2 == 0){
return lgput(x * x % mod, n / 2);
}
else{
return x * lgput(x *x % mod, n / 2);
}
}
int main(){
int n, p;
fin>>n>>p;
fout<<lgput(n, p)<<"\n";
return 0;
}