After point swaps in an array, answer queries asking whether a subarray is nondecreasing.
Medium6Segment treeArrayNo attempts yetTime limit1sMemory limit256 MBN freshmen joined KAIST. They are numbered 1 to N, and person i has height Ai. At the start the freshmen stand in one line in order of their numbers.
Kang Hanpil wants to pat the freshmen X times. On one pat he pats everyone from person L to person R. L and R change on every pat.
He wants every pat to be gentle, so for each integer j with L≤j<R he wants the height of person j+1 to be no smaller than the height of person j. If even one such j fails that, Kang Hanpil gets angry on that pat. When L=R there is no j to check, so he does not get angry.
Some freshmen want to be patted and some do not, so between the pats person L and person R swap places Y times. L and R can change on every swap.
Given the number of freshmen and their heights, the pats, and the swaps, print whether Kang Hanpil gets angry on each pat.
The first line contains N (1≤N≤100000) and X+Y (1≤X+Y≤100000), separated by a space.
The second line contains N integers Ai (1≤Ai≤109), the heights.
Each of the next X+Y lines contains three natural numbers Q, L, R, separated by spaces. (Q is 1 or 2, and 1≤L≤R≤N.)
Q=1 means Kang Hanpil pats everyone from person L to person R. Q=2 means person L and person R swap places.
Print X lines.
On line i, print HSS090 if Kang Hanpil gets angry on his i-th pat, and CS204 if he does not.