• + 1 comment

    I got 150 using 26 data structures, each of them got the update value in O(1) because of the constraint (m<=101), you can generate all posible remainders to each of the posibles values of m, and then you find the period in no more than m^2 . But when you read the editorial, they use binpow to get all the updates that cost a lot, but they solve the problem with just 5 data structures... nice problem!