Not Equal on a Segment CodeForces - 622C
You are given array?a?with?n?integers and?m?queries. The?i-th query is given with three integers?li,?ri,?xi.
For the?i-th query find any position?pi?(li?≤?pi?≤?ri) so that?api?≠?xi.
The first line contains two integers?n,?m?(1?≤?n,?m?≤?2·105) — the number of elements in?a?and the number of queries.
The second line contains?n?integers?ai?(1?≤?ai?≤?106) — the elements of the array?a.
Each of the next?m?lines contains three integers?li,?ri,?xi?(1?≤?li?≤?ri?≤?n,?1?≤?xi?≤?106) — the parameters of the?i-th query.
Print?m?lines. On the?i-th line print integer?pi?— the position of any number not equal to?xi?in segment?[li,?ri]?or the value??-?1?if there is no such number.
總結
以上是生活随笔為你收集整理的Not Equal on a Segment CodeForces - 622C的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: @MySQL的存储引擎
- 下一篇: cad字体安装_装了1个G的CAD字体后