Query solving in most optimised way

Revision en1, by 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.

Tags query, lower bound

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gXa 2018-01-18 16:17:56 305 Initial revision (published)