Comments

hey, your explanation is pretty good, I got to the same kind of reasoning during the contest. Could you (or anyone!) elaborate on the idea of calculating the n-th row of Pascal's triangle fast? Based on your solution I can see that it is based on Fermat's theorem but I cannot understand it fully.

Any link to the place where this is explained would be helpful!

Hi there, I am trying to upsolve problems from this contest and I am struggling to see why I am getting the Runtime Error on test 2 for problem E. Here is the code:

https://codeforces.me/contest/1506/submission/111272555

Sadly I cannot see all the tests and have no clue where the error might be. Any help would be very much appreciated.

Spot on mate! Thanks a lot, this was indeed the problem here.

hi there! great contest, although I am still struggling with problem C.

here is my submission: https://codeforces.me/contest/1481/submission/106619632

probably there is some obvious reason why it fails but cannot find it, cannot deduce that also from test cases, anyone could advise? cheers!