# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
488610 | flowmaster | Collider (IZhO11_collider) | C++14 | 417 ms | 2404 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |