SCU Practice Contest 2 In Summer

G: Longest Ordered Subsequence (II)