Pagini recente » Cod sursa (job #2480270) | Cod sursa (job #3001794) | Cod sursa (job #2978400) | Cod sursa (job #2663130) | Cod sursa (job #1017080)
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <deque>
#include <vector>
#include <string>
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define NMOD 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long int exp(int b, int e);
int main()
{
int n,p;
f>>n>>p;
g<<exp(n,p)%NMOD;
return 0;
}
long int exp(int b,int e)
{
int h=0;
if(e==1) return b%NMOD;
if(e%2==0)
{
h=exp(b,e/2)%NMOD;
return h*h%NMOD;
}
else
{
h=exp(b,e/2)%NMOD;
return (((h*h)%NMOD)*b)%NMOD;
}
}