Cod sursa(job #3369205)
| Utilizator | Data | 17 octombrie 2026 16:50:18 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const long long MOD = 1999999973;
long long fastPow(long long a, long long b){
long long p = 1;
while(b){
if(b&1)
p = (p * a) % MOD;
a = (a * a) % MOD;
b>>=1;
}
return p;
}
long long a, b;
int main() {
fin>>a>>b;
fout<<fastPow(a, b);
return 0;
}
