# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336961 | kutbilim_one | Collider (IZhO11_collider) | C++14 | 867 ms | 2440 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.
/** @kutbilimone **/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define all(x) x.begin(),x.end()
#define int long long
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
string s;
cin >> s;
for(int i = 0, x, y; i < m; i++){
char oper;
cin >> oper >> x;
x--;
if(oper == 'a'){
cin >> y;
y--;
char temp = s[x];
s.erase(s.begin()+x);
s.insert(s.begin()+y, temp);
}else cout << s[x] << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |