Cod sursa(job #2493300)
Utilizator | Data | 16 noiembrie 2019 11:28:22 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll modp=1999999973;
ll lgp(ll a,ll b){
if(b==0) return 1;
ll t=lgp(a,b/2);
if(b%2==1) return (((t*t)%modp)*a)%modp;
return (t*t)%modp;
}
ll n,m;
int main(){
ifstream fin;
fin.open("");
ofstream fout;
fout.open("");
fin>>n>>m;
fout<<lgp(n,m);
return 0;
}