Pagini recente » Cod sursa (job #2248527) | Cod sursa (job #1363135) | Cod sursa (job #3293638) | Cod sursa (job #1214171) | Cod sursa (job #533095)
Cod sursa(job #533095)
#include <algorithm>
#include <fstream>
using namespace std;
const char Input[] = "lgput.in";
const char Output[] = "lgput.out";
const int Mod = 1999999973;
long long int N, P, XXX;
int main() {
ifstream fin( Input );
ofstream fout( Output );
int i;
long long int aux;
fin >> N >> P;
XXX = 1;
aux = N;
for( i = 0; (1LL << i) <= P; ++i ) {
if( (1LL << i) & P )
XXX = (XXX * aux) % Mod;
aux = (aux * aux) % Mod;
}
fout << XXX;
fin.close();
fout.close();
return 0;
}