# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168537 | abil | Collider (IZhO11_collider) | C++14 | 707 ms | 3504 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>
#define fr first
#define sc second
#define pb push_bacak
#define mk make_pair
#define all(s) s.begin(),s.end()
//#define int long long
using namespace std;
const int N = (1e6 + 12);
const int mod = (1e9 + 7);
const int INF = (0x3f3f3f3f);
main()
{
string s;
int n, m, l, r;
cin >> n >> m;
cin >> s;
char ch;
while(m--){
cin >> ch;
if(ch == 'a'){
scanf("%d%d", &l, &r);
l--;
r--;
string c = "";
c = (s[l]);
s.erase(l, 1);
s.insert(r,c);
}
else{
scanf("%d", &l);
l--;
printf("%c\n", s[l]);
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |