Help with TLE on CF 355 problem D

Правка en1, от AnotherRound, 2016-06-08 12:19:43

After reading the solution to problem D from last CF round, I decided to implement it(the idea with 2D segment tree). I know that there are other(faster) ways to implement segment tree as needed for RMQ, but I wanted to implement it with standard(check my code for what I call standard) implementation of 2D seg tree. Unfortunately, I got TL on test 16. So I wanted to ask whether there is some way to optimise my solution(without using the other faster way to implement segment tree). Link to my code: http://codeforces.com/contest/677/submission/18295468

Теги #codeforces, segment-tree, #355 div2 d

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский AnotherRound 2016-06-08 12:19:43 590 Initial revision (published)