Last non-zero digit of nPm

Правка en2, от snorkel, 2021-04-20 02:35:22

Trying to solve this problem. I got the last non-zero digit by working with $$$2$$$-s and $$$5$$$-s, but here's an easier solution by using $$$10$$$ directly.

Can anyone explain why this works? How taking modulo $$$10^9$$$ does not make it wrong?

Code

Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский snorkel 2021-04-20 02:35:22 215
en1 Английский snorkel 2021-04-20 02:13:42 720 Initial revision (published)