# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1075502 | coolboy19521 | Collider (IZhO11_collider) | C++17 | 177 ms | 19540 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#include "ext/rope"
#define ll long long
using namespace std;
using namespace __gnu_cxx;
int main() {
int n, m;
cin >> n >> m;
rope<char> rp;
for (int i = 0; i < n; i ++) {
char c; cin >> c;
rp.push_back(c);
}
while (m --) {
char c; cin >> c;
if ('a' == c) {
int a, b; cin >> a >> b;
a --, b --;
char c = rp[a];
rp.erase(rp.mutable_begin() + a);
rp.insert(rp.mutable_begin() + b, c);
} else {
int x; cin >> x;
x --;
cout << rp[x] << '\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |