How do I optimize my Mo's algorithm solution?

Правка en3, от coco_elon, 2017-06-03 10:24:25

This is my solution for 86D : Powerful Array. Link: http://ideone.com/618TcS

This gave me a TLE at test 6, taking more than 5000 ms whereas most AC solutions pass at 800 — 1000 ms. How do I optimize my code? Thanks in advance!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский coco_elon 2017-06-03 12:32:06 1147 Reverted to en3
en4 Английский coco_elon 2017-06-03 12:32:00 1147 Reverted to en2
en3 Английский coco_elon 2017-06-03 10:24:25 1147
en2 Английский coco_elon 2017-06-03 10:22:02 36
en1 Английский coco_elon 2017-06-03 10:19:22 1351 Initial revision (published)