Pagini recente » Cod sursa (job #630052) | Cod sursa (job #1358216) | Cod sursa (job #785862) | Cod sursa (job #2430865) | Cod sursa (job #1526027)
#include <iostream>
#include <fstream>
using namespace std;
const int oo = 1999999973 ;
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
int n,m ;
scanf("%d %d",&n ,&m);
unsigned long long x = n ,y = 1;
if (n == 0) printf("1");
while (m > 1) {
if (m %2 == 0) {
x = (x*x) % oo ;
m = m / 2;
}
else {
y = (y*x)%oo;
x = (x*x)%oo;
n = (n-1)/2;
}
}
int result = (x*y) % oo ;
printf("%d" , result);
fclose(stdin);
fclose(stdout);
return 0;
}