Comparing Arrays
View as PDFGiven an array, , of 
 integers, answer 
 queries of 
 types:
1 l_1 r_1 l_2 r_2: Output 1 if the subarray from  is identical to 
 or 
0 if they are not identical. An array is identical to another if the lengths are equal and the same numbers are present in the same order.
2 i v: Update the integer at index  to 
.
Constraints
For all subtasks:
Subtask 1 [20%]
Subtask 2 [80%]
No additional constraints.
Input Specification
The first line will contain  and 
, the number of integers in the array and the number of queries, respectively.
The next line will contain  integers, the array's contents.
The next  lines will contain one of two queries.
Output Specification
For each query of type , output 
1 if the arrays are identical and 0 if they are not.
Sample Input
5 4
1 3 1 3 1
1 1 5 1 5
1 1 3 3 5
2 3 4
1 1 3 3 5
Sample Output
1
1
0
Comments