Pagini recente » Cod sursa (job #356289) | Cod sursa (job #2415111) | Cod sursa (job #771741) | Cod sursa (job #152342) | Cod sursa (job #1460673)
/*
* =====================================================================================
*
* Filename: lgput.cpp
*
* Description:
*
* Version: 1.0
* Created: 07/13/2015 03:09:38 PM
* Revision: none
* Compiler: gcc/g++
*
* Author: Marius-Constantin Melemciuc
* email:
* Organization:
*
* =====================================================================================
*/
#include <iostream>
#include <fstream>
#define LARGE_NUMBER 1999999973
using namespace std;
int powOfNumber(long long int x,
long long int y) {
long long int result = 1;
while (y != 0) {
if ((y & 1) == 1) {
result = (result * x) % LARGE_NUMBER;
}
x = (x * x) % LARGE_NUMBER;
y = y >> 1;
}
return result;
}
int main() {
ifstream in("lgput.in");
ofstream out("lgput.out");
long long int n, p;
in >> n >> p;
out << powOfNumber(n, p);
in.close();
out.close();
return 0;
}