#P5313. [Ynoi2011] WBLT
[Ynoi2011] WBLT
Description
You are given a sequence of length , with query operations.
Each query gives parameters . You need to output the maximum such that there exists an with satisfying that have all appeared at least once within the interval .
If no number in exists, output .
Input Format
The first line contains an integer .
The second line contains integers representing the sequence.
The third line contains an integer .
Then follow lines, each containing three integers , representing one query operation.
Output Format
For each query operation, output one line with one integer representing the answer.
6
1 1 4 5 1 4
3
1 6 1
2 3 3
3 4 1
0
2
0
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: ccz181078, Data: ccz181078&Forever_Pursuit.
For of the testdata, all numbers that appear are within .
For another of the testdata, .
For of the testdata, all numbers that appear are within .
Translated by ChatGPT 5
京公网安备 11011102002149号