Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

prabal1815's blog

By prabal1815, history, 7 years ago, In English

Yesterday I was doing a question 86D - Powerful array.

I implemented Mo's algorithm and got TLE in java. Then after some modifications in got accepted in 4740 ms (27581138). I started seeing the solution of others users to find ways to optimize my code so that it gets accepted in less time. I came across this solution (14855687) which passed in 2306 ms (almost half). I tried my best to do exactly the same but still my code runs in almost the same time as earlier. This time it was around 4802 ms (27581630).

Can anybody tell me what exactly is the reason behind this and what should I do to pass my submission in less time?

Thanks in advance!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it