#include using namespace std; using Int = long long; #include #include #include using namespace __gnu_pbds; template using gtree = tree,rb_tree_tag,tree_order_statistics_node_update>; // usage: // find_by_order(Int k): return the iterator of k-th smallest element (0-indexed) // order_of_key(T key): return the index of key in tree //INSERT ABOVE HERE signed main(){ Int q,k; cin>>q>>k; using P = pair; gtree

g; for(Int i=0;i>t; if(t==1){ Int x; cin>>x; g.insert(P(x,i)); } if(t==2){ if((Int)g.size()