Pagini recente » Diferente pentru problema/matrita intre reviziile 40 si 41 | Cod sursa (job #531169) | Cod sursa (job #1593452) | Cod sursa (job #1424158) | Cod sursa (job #1923011)
#include <fstream>
#define mod 1999999973
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
int main (){
int x,n;
fin >> x >> n;
int y = 1;
while (n > 1){
if (n%2==0){
x = 1LL*x*x%mod;
n = n/2;
}
else {
y = 1LL * y * x%mod;
x = 1LL * x * x%mod;
n = (n-1)/2;
}
}
int rasp = 1LL * x * y%mod;
fout << rasp;
}