Pagini recente » Cod sursa (job #1533726) | Cod sursa (job #2314279) | Cod sursa (job #628991) | Cod sursa (job #1941320) | Cod sursa (job #2906847)
#include <bits/stdc++.h>
#include <ext/rope>
using namespace std;
using vec = __gnu_cxx::rope<int>;
#ifndef LOCAL
ifstream in("secv8.in");
ofstream out("secv8.out");
#define cin in
#define cout out
#endif // LOCAL
int main() {
int q; cin >> q;
{ string _unused; cin >> _unused; assert(_unused == "0"); }
vec v;
while(q--) {
char ch; cin >> ch;
if(ch == 'I') {
int x, n; cin >> x >> n;
v.insert(x - 1, n);
}
if(ch == 'A') {
int x; cin >> x;
cout << v[x - 1] << '\n';
}
if(ch == 'D') {
int x, y; cin >> x >> y;
v.erase(x - 1, y - x + 1);
}
if(ch == 'R') {
int _x, _y; cin >> _x >> _y;
}
// for(auto e : v) cerr << e << " "; cerr << endl;
}
for(auto e : v) cout << e << " ";
}