Cod sursa(job #2900045)
Utilizator | Data | 9 mai 2022 23:02:53 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
#define mod 1999999973
int64_t n, k;
int64_t fp(int64_t a, int64_t b){
int64_t p = 1;
while(b){
if(b & 1)
p = p * a % mod;
a = a * a % mod;
b /= 2;
}
return p;
}
int main(){
fin >> n >> k;
fout << fp(n, k);
}