Блог пользователя deam0n

Автор deam0n, 14 лет назад, По-английски

I'm trying to solve a RMQ problem at lightoj using Segment Tree , but it always gives me TLE. Can anybody help in pointing out my mistake ?

Problem link : http://www.lightoj.com/volume_showproblem.php?problem=1082

Code link : http://pastebin.com/UqaumDKG

Теги rmq
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
14 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I had the same problem many times in SPOJ. First, try replacing 'endl' by '\n'. If still TLE, try using stdio.h instead of iostream.