Pagini recente » Cod sursa (job #2803734) | Cod sursa (job #1266038) | Cod sursa (job #1332706) | Cod sursa (job #1691303) | Cod sursa (job #487173)
Cod sursa(job #487173)
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <string>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <cassert>
#include <stdio.h>
#include <cmath>
#include <iostream>
#include <fstream>
using namespace std;
const long long MODULE = 1999999973;
long long go( long long a, long long b ){
//cout << "test";
if ( b<0) return go(a,-b);
if ( b==0) return 1;
if ( b==1) return a%MODULE;
if ( b%2==0){
long long aux =go(a,b/2)%MODULE;
return (aux*aux)%MODULE;
}
else{
long long aux = go(a,b/2)%MODULE;
return (((aux*aux)%MODULE)*a)%MODULE;
}
}
int main() {
// cout << ( 1<<31-1);
ifstream input("lgput.in");
ofstream output("lgput.out");
// cout << " start \n";
long long a;
long long b;
input >> a >> b;
output << go ( a, b) << endl;
output.close();
return 0;
}