Cod sursa(job #3038018)
Utilizator | Data | 26 martie 2023 19:02:11 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long n,p;
int k;
int main()
{
fin>>n>>p;
long long prod=1;
while(p)
{
if(p%2==1)
{
prod=prod*n;
}
n=n*n;
p/=2;
}
long long procent=prod%1999999973;
fout<<procent;
return 0;
}