Data Structure Problem: How do I optimize my solution for SPOJ KQUERY2 — K-query II?

Правка en1, от Tobby_And_Friends, 2016-09-06 20:10:09

I tried to implement the problem using segment tree and multisets. I got a verdict of TLE. How can I optimize my code? Or is there a better solution?

Problem link: http://www.spoj.com/problems/KQUERY2/en/

Solution link: http://ideone.com/gDAmUW

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Tobby_And_Friends 2016-09-06 20:10:09 334 Initial revision (published)