# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
336960 | kutbilim_one | 입자 가속기 (IZhO11_collider) | C++14 | 2096 ms | 8112 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/** @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... |