Pagini recente » Cod sursa (job #2969292) | Cod sursa (job #2849462) | Cod sursa (job #548622) | Cod sursa (job #1429259) | Cod sursa (job #1301522)
#include <fstream>
using namespace std;
#define MOD 1999999973
ifstream is ("lgput.in");
ofstream os ("lgput.out");
long long x, n, p;
long long Lpow(long long x, long long y)
{
if (y == 0) return 1;
if (y == 1) return x;
if (y % 2 == 0)
return Lpow((1LL*x*x) % MOD, y / 2) % MOD;
if (y % 2 == 1)
return (1LL*x*Lpow((1LL*x*x) % MOD, y / 2)) % MOD;
};
int main()
{
is >> n >> p;
os << Lpow(n, p);
is.close();
os.close();
return 0;
}