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

Автор Master_coder, история, 6 лет назад, По-английски

how to do this problem with segment tree data structure. https://www.codechef.com/SEPT17/problems/SEACO

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

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

First of all, you need to count how many times a command will be executed. It can done by starting with higher index and work only for type 2.

Secondly, for each command of type 1 perform this command previously calculated times.

Sorry for my bad English.

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

Almost Same Problem: 295A - Greg and Array

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

I think it could be solved using prefix sums :D