# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89130 | turbat | Collider (IZhO11_collider) | C++14 | 738 ms | 11604 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>
using namespace std;
vector <char> ve;
int x, n, m, y;
string st;
char c;
int main (){
cin >> n>> m >> st;
for (int i = 0;i < n;i++){
c = st[i];
ve.push_back(c);
}
while (m--){
cin >> c;
if (c == 'a'){
cin >> x>> y;
c = ve[x - 1];
ve.erase(ve.begin() + x - 1);
ve.insert(ve.begin() + y - 1, c);
}
else{
cin >> x;
cout << ve[x - 1]<<'\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |