Pagini recente » Cod sursa (job #9471) | Cod sursa (job #2676928) | Cod sursa (job #3189450) | Cod sursa (job #1064797) | Cod sursa (job #2930351)
#include <fstream>
using namespace std;
#define mod 1999999973
int main()
{
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long a, b, aux = 1, rez = 1, putere, aux3;
fin >> a >> b;
putere = a;
while (aux<=b)
{
aux3 = (b & aux);
if (aux3 != 0)
rez*=putere;
rez %= mod;
aux <<= 1;
putere*= putere %mod;
putere %= mod;
}
fout << rez%mod;
return 0;
}