Cod sursa(job #2397759)
Utilizator | Data | 4 aprilie 2019 19:07:59 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main()
{int n,p;
long long x;
fin>>n>>p;
x=n;
for(int i=1;i<=p/2;i++)
{
x=x*n;
x=x%1999999973;
}
n=x*2;
fout<<n%1999999973;
}