# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
686341 | Ronin13 | Collider (IZhO11_collider) | C++14 | 250 ms | 19448 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>
#include <ext/rope>
#define ll long long
#define ull unsigned ll
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
using namespace std;
using namespace __gnu_cxx;
const int nmax = 5e5 + 1;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
crope r = "";
int n; cin >> n;
int m; cin >> m;
for(int i = 1; i <= n; ++i){
char x; cin >> x;
r.pb(x);
}
for(int i = 1; i <= m; i++){
char t; cin >> t;
if(t == 'a'){
int x, y; cin >> x >> y;
char v = r[x - 1];
r.erase(x - 1, 1);
r.insert(y - 1, v);
}
else{
int x; cin >> x;
cout << r[x - 1] << "\n";
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |