Cod sursa(job #296655)
Utilizator | Data | 4 aprilie 2009 23:33:28 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include<stdio.h>
#include<math.h>
void readd(),solve();
int n,p,solutie;
int main()
{
readd();
solve();
return 0;
}
void readd()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d%d",&n,&p);
}
void solve()
{
solutie=int(pow(n,p))%1999999973;
printf("%d",solutie);
}