Submission #897468

#TimeUsernameProblemLanguageResultExecution timeMemory
897468kokoueCollider (IZhO11_collider)C++14
100 / 100
230 ms2700 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-1]; a.erase(a.begin()+idx-1); a.insert(a.begin()+idx2-1,temp); // for(int j=0;j<a.size();j++) cout<<a[j]<<" "; // cout<<"\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...