为了造福后人,这里提供一份数据生成器。
需要注意的是,这个数据生成器并不保证序列不被删空。如果想要保证序列一定不被删空,请让 n>m。
#include <bits/stdc++.h>
using namespace std;
#define int long long
mt19937 rnd(time(0));
int n=11, m=10;
auto op="IDRQ";
signed main() {
cout<<n<<'\n';
for (int i=1; i<=n; ++i) cout<<rnd()%10000ll-5000<<" \n"[i==n];
cout<<m<<'\n';
while (m--) {
char o=op[rnd()%4];
int x=rnd()%n+1, y=rnd()%10000ll-5000;
cout<<o<<' ';
if (o=='Q') {
y=rnd()%n+1;
if (x>y) swap(x,y);
}
if (o=='D') cout<<x, n--;
else cout<<x<<' '<<y;
cout<<'\n';
}
}