最长上升子序列,枚举. 因为$10000$最多只有$10$个,所以可以枚举采用哪一个$10000$,因为是一个环,所以每次枚举到一个$10000$,可以把这个移到最后,然后算从前往后的$LIS$和从后往前的$LIS$,然后枚举一下哪里断开就可以了. #include<bits/stdc++.h> using namespace std; ],n; ],dp1[],dp2[]; ],u,mx1[],mx2[]; void get(int L,int R,int l,int r,int rt) {…