Submission #89130

#TimeUsernameProblemLanguageResultExecution timeMemory
89130turbatCollider (IZhO11_collider)C++14
100 / 100
738 ms11604 KiB
#include <bits/stdc++.h> using namespace std; vector <char> ve; int x, n, m, y; string st; char c; int main (){ cin >> n>> m >> st; for (int i = 0;i < n;i++){ c = st[i]; ve.push_back(c); } while (m--){ cin >> c; if (c == 'a'){ cin >> x>> y; c = ve[x - 1]; ve.erase(ve.begin() + x - 1); ve.insert(ve.begin() + y - 1, c); } else{ cin >> x; cout << ve[x - 1]<<'\n'; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...