ABC186 Panasonic Programming Contest (AtCoder Beginner Contest 186) - AtCoder For the sixth question, I got to the point where I could use a phoenix tree, so I implemented naive and then made a phoenix tree version and submitted it, but the answers didn’t match, and with 2 minutes left to go after checking the discrepancy between naive and phoenix for random inputs, I thought, “The naive method is wrong in the first place!” with 2 minutes left. image Still, the rate is going up, so I guess E was blue difficulty too. I simply had to divide, but when finding the inverse in mod P, I got stuck in a place where I couldn’t use Fermat’s minor theorem unless P was prime. I had to go back to the extended Euclidean method. image

ABC186D ABC186E ABC186F

This page is auto-translated from /nishio/ABC186 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.