Pagini recente » Cod sursa (job #3252739) | Cod sursa (job #2809236) | Cod sursa (job #1227962) | Cod sursa (job #2650148) | Cod sursa (job #1394919)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int Mod = 1999999973;
int Pow(int n, int p);
int main()
{
int n, p;
fin >> n >> p;
fout << Pow(n, p);
fin.close();
fout.close();
return 0;
}
int Pow(int n, int p)
{
if ( p == 0 ) return 1;
int x = Pow(n, p / 2);
x = (1LL * x * x) % Mod;
if ( p % 2 == 1 ) x = (1LL * x * n) % Mod;
return x;
}