RT,给某些调了很久调不出来的人
#include<bits/stdc++.h>
#define ll long long
#define random(x) rand()*rand()%(x)
using namespace std;
ll n=10,m=10,tot;
int main(){
srand((unsigned)time(NULL));
freopen("1.in","w",stdout);
printf("%lld %lld\n",n,m);
tot=n;
for(ll i=1;i<=n;i++){
char c=(char)('a'+random(26));
cout<<c;
}
printf("\n");
while(m--){
ll opt=random(6)+1;
if(!tot){
if(opt<=3) opt=1;
else opt=4;
}
if(opt==1){
printf("I ");
ll x=random(tot+1);
char c=(char)('a'+random(26));
cout<<x<<" "<<c<<endl;
tot++;
}
if(opt==2){
printf("D ");
ll x=random(tot)+1;
printf("%lld\n",x);
tot--;
}
if(opt==3){
printf("R ");
ll x=random(tot)+1,y=random(tot)+1;
if(x>y) swap(x,y);
printf("%lld %lld\n",x,y);
}
if(opt==4){
printf("P ");
ll x=random(n)+1;
printf("%lld\n",x);
}
if(opt==5){
printf("T ");
ll x=random(tot)+1;
printf("%lld\n",x);
}
if(opt==6){
printf("Q ");
ll x=random(tot)+1,y=random(tot)+1;
if(x>y) swap(x,y);
printf("%lld %lld\n",x,y);
}
}
}