Doubt in Modular Arithmetic

Правка en1, от bugdone, 2021-08-09 22:19:43

Today in 1557C - Moamen and XOR I wanted to compute $$${(2^{k-1})}^{n}$$$. But instead of writing binpow(binpow(2, k — 1), n), I simplified it to $$$2^{n*(k-1)}$$$ and wrote binpow(2, mul(n, k — 1)) and failed to pass pretest 2.

Why are not the two equivalent?

Теги #modular arithmetic, #help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский bugdone 2021-08-09 22:23:40 10
en1 Английский bugdone 2021-08-09 22:19:43 355 Initial revision (published)