Cod sursa(job #3286213)
Utilizator | Data | 13 martie 2025 20:26:30 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.4 kb |
#include <bits/stdc++.h>
#define int long long
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
int a,b;
const int mod=1999999973;
int power(int a,int b){
int rez=1;
while(b)
{
if(b&1)
rez=1ll*rez*a%mod;
a=1ll*a*a%mod;
b>>=1;
}
return rez;
}
int32_t main()
{
f>>a>>b, g<<power(a,b);
return 0;
}