Comments

Disregard

Hi -

recently I submit this code to this problem; except I get TLE. Solution utilizes 2D segment tree. Anyone can suggest any optimizations that will help it pass?

Thanks in advanced-

Disguised

Use 2D segment tree or store a persistent segment tree at each node :D.

On seland → Codeforces Round #303 (Div.2), 12 years ago
+1

This solution may be hacked by following test case:

3 3 1 2 8 1 3 6 2 3 2 1

Simply doing djikstra — it will output 14; correct answer is 8.