I recently participated in the div 3 contest and tried to solve problem D : Distinct character queries with Square Root Decomposition using a 2D array like block[denoting_which_block][charfreq] and it passed all the 50 odd pretests during contest and I was over the moon because I just recently learned this concept. But today morning, it was hacked sadly :( And I want to know why the solution fails? Should I have used seg/fenwick? This is my submission The thing is we keep looking for a small indication to denote our improvement every single time and feels bad to not grow despite practise
Thanks :)
Anyone?
I don't know much about sqrt trees but I think you should use a faster and easier-to-code data structure — For example, Fenwick tree.
Btw, I hacked the submission using this generator
Thanks:)
You code with fast input would have passed. This is your submission with fast input which did pass the tests.
Oh my god :( Thanks