Cod sursa(job #2626856)
Utilizator | Data | 8 iunie 2020 17:59:09 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
Compilator | py | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
f = open("lgput.in", "r")
g = open("lgput.out", "w")
m = 1999999973
words = f.readline().split()
a = int(words[0])
b = int(words[1])
sol = 1
while b:
if b&1:
sol = (sol*a) % m
a = (a*a) % m
b >>= 1
g.write(str(sol))