Hi, I am trying to solve this problem from ACM ACPC 2017 — Array Queries contest using segment tree + lazy propagation but always gets wrong answer no matter what. Am I missing something or is my approach wrong ?
Here is my code: https://ideone.com/3s2FQk