# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897467 | kokoue | Collider (IZhO11_collider) | C++14 | 0 ms | 456 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<bits/stdc++.h>
using namespace std;
int n,q;
vector<char> a;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>q;
char c;
for(int i=0;i<n;i++)
{
cin>>c;
a.push_back(c);
}
char t;
int idx,idx2;
for(int i=0;i<q;i++)
{
cin>>t;
if(t=='q')
{
cin>>idx;
cout<<a[idx-1]<<"\n";
continue;
}
cin>>idx>>idx2;
char temp=a[idx];
a.erase(a.begin()+idx-1);
a.insert(a.begin()+idx2-1,temp);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |