Submission #897467

#TimeUsernameProblemLanguageResultExecution timeMemory
897467kokoueCollider (IZhO11_collider)C++14
0 / 100
0 ms456 KiB
#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 timeMemoryGrader output
Fetching results...