#P5397. [Ynoi2018] 天降之物
[Ynoi2018] 天降之物
Background
Have you ever had a dream like this?
Beside me, there is a girl I have never met before.
I like her a lot, and she likes me a lot too.
But—
In the end, it is always
When she is taken away by the sky,
That I wake up from the dream.

Human?
No.
Not human.
No one would...
Have wings.

No, no, no.
There is nowhere.
There is nowhere I can go back to.
I have no place I can go back to!
Nowhere...
A place I can go back to... anywhere... nowhere at all...
I do not want to kill anyone, and I do not want to hurt anyone!
Why... why did you create me...
No need... I do not need this kind of power...

“Happiness” is not enough to describe how I feel right now.
What should I say?
Ah, right.
I... love you.
I love you... Master.

In Greek mythology, Icarus flew too close to the sun; the feathers glued on with wax melted, and he fell into the sea and died.
Problem Description
Icarus gives you a sequence of length .
You need to process operations. There are two types of operations:
- Change the value of every element equal to in the sequence to .
- Find a position such that and a position such that , so that is minimized, and output .
Input Format
The first line contains two integers .
The next line contains integers, representing the sequence .
Then follow lines, each containing three numbers .
If is , it means changing the value at every position with value to .
If is , it means finding a position such that and a position such that to minimize , and output . If no such positions can be found, output Ikaros.
This problem is strictly online. For each operation, need to be xor-ed with the answer from two queries ago. If the output is Ikaros, or if it is the first query, then the last answer is .
There are test cases in total, and it is guaranteed that .
Output Format
For each operation of type , output one line with an integer representing the answer.
If it is impossible to find that satisfy the statement, output Ikaros.
5 5
1 2 2 4 4
2 3 3
2 2 4
1 3 2
1 5 5
2 2 5
Ikaros
1
1
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477 ( partially uploaded ).
Constraints: For of the testdata, all numbers are within , and the value in each operation does not exceed .
Translated by ChatGPT 5