Pagini recente » Cod sursa (job #937004) | Diferente pentru treapuri intre reviziile 24 si 151 | Diferente pentru treapuri intre reviziile 50 si 151 | Diferente pentru agm2015 intre reviziile 14 si 7 | Cod sursa (job #2873315)
#include <fstream>
using namespace std;
ifstream fin("moka.in");
ofstream fout("moka.out");
long long putere(long long a, long long p, int mod)
{
if (p == 0) return 1;
else
{
long long x = putere(a, p / 2, mod);
if (p % 2 == 0) return x * x % mod;
else return x * x % mod * a % mod;
}
}
int main()
{
long long a, b;
fin >> a >> b;
fout << putere(a, b, 1999999973);
}