Query solving in most optimised way

Правка en1, от gXa, 2018-01-18 16:17:56

Initially the array contain all 1s.

There are two type of operation:

1 A: update arr[A] = 0.

2 A: Find index of Ath 1 in the array.

Number of elements, 1<=N<=(1e6)

Number of queries, 1<=Q<=(1e6)

I tried tree statistic. However, it didn't pass.

Теги query, lower bound

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский gXa 2018-01-18 16:17:56 305 Initial revision (published)