Pagini recente » Cod sursa (job #2990437) | Cod sursa (job #609542) | Cod sursa (job #1198938) | Cod sursa (job #1587947) | Cod sursa (job #1346278)
#include<fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
const long long REST = 1999999973;
int putere (int a, int b)
{
long long aux = a, ret = 1, i;
for(i = 1; i <= b; i = i<<1)
{
if(i & b) ret = ret * aux;
aux = aux * aux;
ret %= REST;
aux %= REST;
}
return ret;
}
int main()
{
long long n,p;
f >> n >> p;
g << putere(n,p);
return 0;
}