# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336932 | BY_KUTBILIM | Collider (IZhO11_collider) | C++14 | 1 ms | 384 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.
/** @BY_KUTBILIM **/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie();
int n, q;
cin >> n >> q;
vector<char> v;
for(int i = 0; i < n; i++){
char c;
cin >> c;
v.pb(c);
}
while(q--){
char type;
cin >> type;
if(type == 'a'){
int i, j;
cin >> i >> j;
i--; j--;
char c = v[i];
v.erase(v.begin() + i, v.begin() + i + 1);
v.insert(v.begin() + j, c);
} else{
int i;
cin >> i;
cout << v[i] << endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |