Algorithm for modular exponentiation

ALGORITHM 2- MODULAR EXPONENTIATION

alt text
By @pratku123

For more methods and a detailed explanation refer to the wikipedia page of Modular exponentiation.


We posted this on our facebook page and thought that we should share it here also.

-Msitcoderiders (Codechef Campus Chapter MSIT)

After reading this, you can try this question in easy section:

Missing some chairs(MCHAIRS)

Please read the editorial with the problem for maximum gain.

2 Likes