Pagini recente » Cod sursa (job #582305) | Cod sursa (job #2513815) | Cod sursa (job #539491) | Cod sursa (job #590858) | Cod sursa (job #2873329)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.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);
}