taklo's blog

By taklo, history, 5 years ago, In English

We are given an array 'a' of size N. We have 2 type of query Type 1 :- i , x update a[i] with a[i]+x Type 2:- i Give output S. Where S = a[0]+a[1]+.....+a[i] Constraint:- N<=100000 Q<=100000 Where N = size of array Q=Number of query

Example a={1,2,3,4,5,6} Type 1: 0,5 Type 2: 3 Type 1: 4,3 Type 2: 5

Output: 15 29

  • Vote: I like it
  • -16
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is this from a running contest?