1. 程式人生 > >CodeForces 91B Queue (線段樹單點操作)

CodeForces 91B Queue (線段樹單點操作)

The first line contains an integer n (2 ≤ n ≤ 105) — the number of walruses in the queue. The second line contains integers ai (1 ≤ ai ≤ 109).

Note that some walruses can have the same age but for the displeasure to emerge the walrus that is closer to the head of the queue needs to be strictly younger

than the other one.