Submission #488610

#TimeUsernameProblemLanguageResultExecution timeMemory
488610flowmasterCollider (IZhO11_collider)C++14
100 / 100
417 ms2404 KiB
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<char>a(n); for (auto &i : a) { cin >> i; } while (m--) { char x; cin >> x; if (x == 'a') { int i, j; cin >> i >> j; i--; j--; char p = a[i]; if (j != i) { a.erase(a.begin() + i); if (j < i) { a.emplace(a.begin() + j, p); } else { a.emplace(a.begin() + j, p); } } } if (x == 'q') { int q; cin >> q; cout << a[q - 1] << endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...