We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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!
That is very impressive! If it is allowed to ask these without referring to the author's approach,
how much peak memory usage with the DS in your solution,max user time, and how many tree traversals are you making?
Dynamic Summation
You are viewing a single comment's thread. Return to all comments →
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!
That is very impressive! If it is allowed to ask these without referring to the author's approach, how much peak memory usage with the DS in your solution,max user time, and how many tree traversals are you making?
for complete solution in python java c++ and c programming search for programs.programmingoneonone.com on google