Cod sursa(job #3004449)
Utilizator | Data | 16 martie 2023 12:31:23 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.21 kb |
#include<fstream>
using namespace std;
ifstream F("lgput.in");
ofstream G("lgput.out");
long long n,m=2e9-27,y,x;
int main()
{
for(F>>x>>n,y=1;n;n&1?y=x*y%m:0,x=x*x%m,n>>=1);
return G<<y,0;
}