Submission #336932

#TimeUsernameProblemLanguageResultExecution timeMemory
336932BY_KUTBILIMCollider (IZhO11_collider)C++14
0 / 100
1 ms384 KiB
/** @BY_KUTBILIM **/ #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define ll long long int main(){ ios_base::sync_with_stdio(false); cin.tie(); int n, q; cin >> n >> q; vector<char> v; for(int i = 0; i < n; i++){ char c; cin >> c; v.pb(c); } while(q--){ char type; cin >> type; if(type == 'a'){ int i, j; cin >> i >> j; i--; j--; char c = v[i]; v.erase(v.begin() + i, v.begin() + i + 1); v.insert(v.begin() + j, c); } else{ int i; cin >> i; cout << v[i] << endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...