with height h.(h<=10) Type2: Cut the x-th tree from west.(x<=10) After each query, you should calculate the length of LIS of height of tree(from west to east). Before each query, trees grow 1 meter. N: The number of trees ≦ 10^5 M: The number of queries ≦ 2*10^5
h at time t, you should plant a tree with height h-t instead. Then you can ignore the growth of the trees. And plot trees on a x-y plane: x-coordinate is the position and y-coordinate is the modified height (h-t).
will be one of the ten points that have the smallest y-coordinate. To process this query, erase all values written below the new point first and rewrite the values to those points from top to bottom. Solution 1 1 1 2 2 3 4 y x