Comments
0

how to solve E? I heard that it is greedy, but i can't understand. Why greedy works? :(

0

Just count remainder of X.

0

OK. I knew what i did wrong. i had to check duplicated visits :(

0

me too. but i thought it is because of python

0

How to solve D? is it union find?