Given a 01-sequence (sequence consisting only of 0s and 1s) s of length n, you need to find two arrays x and y such that
-
Array x and y are of equal length, and the length should not exceed 120.
-
1≤xi<yi≤n for all 1≤i≤m, where mmm is the length of the two arrays.
-
Algorithm SORT(x,y) can sort all 01-sequences of length n correctly except for the given one. Here algorithm SORT(x,y) takes as input a 01-sequence a of length n, and is described as follows:
-
Iterate over all integers from 1 to m. For each integer i during the iteration, swap axi and ayi if axi>ayi.