Submission #336958

#TimeUsernameProblemLanguageResultExecution timeMemory
336958kutbilim_oneCollider (IZhO11_collider)C++14
0 / 100
1 ms364 KiB
/** @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; s += " "; for(int i = 0; i < m; i++){ char oper; cin >> oper; if(oper == 'a'){ int x, y; cin >> x >> y; if(x > y){ char temp = s[x-1]; s.erase(s.begin()+x-1); s.insert(s.begin()+y-1, temp); }else{ s.insert(s.begin()+y-1, s[x-1]); s.erase(s.begin()+x-1); } }else{ int x; cin >> x; cout << s[x-1] << endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...