Pagini recente » Borderou de evaluare (job #199630) | Borderou de evaluare (job #970104) | Borderou de evaluare (job #1713436) | Borderou de evaluare (job #1700188) | Cod sursa (job #2249210)
#include <bits/stdc++.h>
#define BOSCHETE 1999999973
using namespace std;
int main() {
int a, b, p;
ifstream fin( "lgput.in" );
fin >> a >> b;
fin.close();
p = 1;
while ( b ) {
p %= BOSCHETE;
if ( b % 2 == 1 )
p *= a;
a = ( a * a ) % BOSCHETE;
b /= 2;
}
ofstream fout( "lgput.out" );
fout << p;
fout.close();
return 0;
}