# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336960 | kutbilim_one | Collider (IZhO11_collider) | C++14 | 2096 ms | 8112 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--;
if(y < x){
s = s.substr(0, y) + s[x] + s.substr(y, x-y) + s.substr(x+1);
}else{
s = s.substr(0, x) + s.substr(x+1, y-x) + s[x] + s.substr(y+1);
}
}else cout << s[x] << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |