QCHEF — Help needed with Mo's Algorithm

Правка en1, от Death_Scythe, 2016-06-30 22:48:54

Hello!

I am trying to solve this problem https://www.codechef.com/problems/QCHEF using Mo's Algorithm+Segment Tree but my solution times out. Complexity of my solution is . Is it possible to eliminate the log factor? I know there is an editorial with the problem, (it uses a different decomposition, I think) but I am wondering if my solution can be optimised to .

My solution: https://www.codechef.com/viewsolution/10638667

Thanks!

Теги codechef, mos_algorithm, segment tree, help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Death_Scythe 2016-06-30 22:48:54 545 Initial revision (published)