Pagini recente » Diferente pentru utilizator/andreistanescu intre reviziile 6 si 7 | Clasament simulare-cartita-03 | Cod sursa (job #801891) | Cod sursa (job #2954206) | Cod sursa (job #2258115)
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
unsigned long long putere(unsigned long long a,unsigned long long b) {
if (a==1) {
return 1;
}
if(b==0) {
return 1;
}
if (b==1) {
return a%1999999973;
}
if (b%2==0) {
return putere((a*a)%1999999973,b/2)%1999999973;
} else {
return a*putere((a*a)%1999999973,b/2)%1999999973;
}
}
int main() {
unsigned long long a,b;
f>>a>>b;
g<<putere(a,b)<<'\n';
return 0;
}