Pagini recente » Cod sursa (job #1971153) | Cod sursa (job #2804474) | Cod sursa (job #1528635) | Cod sursa (job #2675876) | Cod sursa (job #591058)
Cod sursa(job #591058)
#include <cstdio>
#define L 100
#define mod 1999999973
using namespace std;
int n,p;
void citeste()
{
freopen("lgput.in","r",stdin);
scanf("%d %d", &n, &p);
fclose(stdin);
}
int powlog(int p)
{
if(p<=1)
return n;
int sol = powlog(p/2);
sol = ( 1LL * sol * sol ) %mod;
if(p%2)
sol = ( 1LL * sol * n ) %mod;
return sol;
}
void afiseaza()
{
freopen("lgput.out","w",stdout);
printf("%d",powlog(p));
fclose(stdout);
}
int main()
{
citeste();
afiseaza();
return 0;
}