请看看我为什么RE了
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
string s = " ";
int q;
int main() {
for (cin >> q; q; q--) {
char c;
cin >> c;
if (c == 'I') {
int i;
string x;
cin >> i >> x;
s.insert(i, x);
}
else {
int x;
cin >> x;
s.replace(max(x - 1, 0), x, " ");
}
}
cout << s << endl;
return 0;
}