Pagini recente » Cod sursa (job #1262421) | Cod sursa (job #1389651) | Cod sursa (job #366336) | Cod sursa (job #1486389)
#include <fstream>
#include <iostream>
#define mod 1999999973;
using namespace std;
long long int p(long long int a, long long int b){
if (b == 0) return 1;
else if (b == 1) return a % 1999999973;
else if (!(b % 2)) return (p(a*a % 1999999973, b / 2) % 1999999973);
else return a*p(a*a % 1999999973, (b - 1) / 2) % 1999999973;
}
int main(){
long long int N, P;
ifstream f("lgput.in");
ofstream of("lgput.out");
f >> N >> P;
of << p(N, P) % 1999999973;
return 0;
}