Getting TLE in MO's Algorithm with updates [SPOJ ADAUNIQ — Ada and Unique Vegetable]

Правка en2, от Tobby_And_Friends, 2017-10-31 21:20:51

Problem link: http://www.spoj.com/problems/ADAUNIQ/

My solution: https://ideone.com/srH91b

Verdict: TLE

How do I optimize my solution? Any help is really appreciated.

[Update] Got AC :) I missed out the fact that block sizes are of n^(2/3)

Теги mos_algorithm, datastructure

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Tobby_And_Friends 2017-10-31 21:20:51 78
en1 Английский Tobby_And_Friends 2017-10-31 20:23:34 259 Initial revision (published)