个人记录去年梁思宇要的#include <bits/stdc++.h> using namespace std; const int MAXN=8005; int n,q; int t[MAXN]; struct node{ int pre,id; }a[MAXN]; bool cmp(node x,…