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

Автор Ttube_lightT, история, 3 года назад, По-английски

Problem: 296C - Greg and Array Submission using two segment trees: 119576218

Here, the operations are range updates on the given array by some value. So, I thought of segment tree with lazy propagation. The operations are indexed and the operations within a range of indices are repeated, for which I kept another segment tree with lazy propagation.

I couldn't figure out why the solution is getting WA on test 11. Any help is appreciated.

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

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

You don't need to use segment trees. Prefix sum is enough too solve the problem. Look at my submission https://codeforces.com/contest/296/submission/119597052.