luogu#P5065. [Ynoi Easy Round 2014] 不归之人与望眼欲穿的人们
[Ynoi Easy Round 2014] 不归之人与望眼欲穿的人们
Background
【The First Fleet has sent a message】
【It is about the battle result of Floating Island No. 15】
【The defense operation of Floating Island No. 15...】
【Has failed...】






Problem Description
Chtholly gives you a sequence. It supports point updates, and queries asking for the minimum possible length of an interval whose bitwise OR sum is greater than or equal to a given number. If there is no solution, output .
Input Format
The first line contains two integers .
The next line contains integers, representing the sequence .
The next lines are in one of the following forms:
- : set to .
- : query the minimum length such that there exists an interval of that length whose bitwise OR sum is .
Output Format
For every operation of type , output one line containing an integer, the answer. If there is no solution, output .
2 3
0 2
2 3
1 1 1
2 3
-1
2
Hint
Idea: kczno1.
Solution: kczno1 ( solution), liu_cheng_ao ( solution), 142857cs ( solution).
Code: kczno1 ( code), liu_cheng_ao ( ) code).
Data: kczno1.
Constraints: For of the testdata, , .
Translated by ChatGPT 5