Submission #336961

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