Ideal infinity for segment tree

Правка en1, от dush1729, 2020-02-17 22:08:31

Hi,

I was solving CYCLCSUM from recent Codechef Cook Off. I used segment tree to solve the problem. I got accepted when I set negative infinity as -1e15 and wrong answer when it is -1e18. I am probably getting wrong answer due to overflow.

So my question what should be the value of infinity in segment tree to avoid overflow?

Теги #segment tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dush1729 2020-02-17 22:08:31 509 Initial revision (published)