# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
575415 | KoD | Collider (IZhO11_collider) | C++17 | 218 ms | 19452 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/extc++.h>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, q;
std::cin >> n >> q;
__gnu_cxx::rope<char> r;
while (n--) {
char c;
std::cin >> c;
r.push_back(c);
}
while (q--) {
char c;
std::cin >> c;
if (c == 'a') {
int x, y;
std::cin >> x >> y;
x -= 1, y -= 1;
const char v = r[x];
r.erase(x, 1);
r.insert(y, v);
} else {
int k;
std::cin >> k;
k -= 1;
std::cout << r[k] << '\n';
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |