Submission #867402

#TimeUsernameProblemLanguageResultExecution timeMemory
867402hentai_loverCollider (IZhO11_collider)C++14
0 / 100
1 ms344 KiB
///for JN #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; void solve(){ tree<pair<int, pair<int, char> >, null_type,less<pair<int, pair<int, char> >>, rb_tree_tag,tree_order_statistics_node_update> st; int n, q; cin>>n>>q; int id = 100000000; for(int i = 0; i < n; i += 1){ char c; cin>>c; st.insert({i, {-- id, c}}); } while(q --){ char c; cin>>c; if(c == 'q'){ int x; cin>>x; x -= 1; auto it = st.find_by_order(x); cout<<(*it).second.second<<"\n"; } else { int x, y; cin>>x>>y; x -= 1; y -= 1; auto it = st.find_by_order(x); pair<int, pair<int, char> > tmp = *it; tmp.second.first -= 1; tmp.first = y; st.erase(it); st.insert(tmp); } } } int main() { int T; //cin>>T; solve(); return 0; }

Compilation message (stderr)

collider.cpp: In function 'int main()':
collider.cpp:48:9: warning: unused variable 'T' [-Wunused-variable]
   48 |     int T;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...