15641561
Posted limited_Infinite
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了15641561相关的知识,希望对你有一定的参考价值。
#include <iostream> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; struct node{ int val,id; node(int a,int b){ val=a; id=b; } inline bool operator > (const node b)const { return val==b.val?id>b.id:val>b.val; } }; tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update> t,temp; int n,min_cash,tcin,s,ans,com; int main() { ios::sync_with_stdio(false); cin>>n; for (int i = 0; i < n; ++i) { cin>>com>>tcin; if(com==1) t.insert((tcin<<20)+i); else if(com==2){ t.erase(t.lower_bound(tcin<<20)); }else if(com==3){ cout<<t.order_of_key((tcin<<20)+1)<<endl; }else if(com==4){ ans=*t.find_by_order(tcin-1); }else if(com==5){ ans=*--t.lower_bound(tcin<<20); }else ans=*t.lower_bound((tcin+1)<<20); printf("%lld\\n",ans>>20);//一并处理ans } return 0; }
以上是关于15641561的主要内容,如果未能解决你的问题,请参考以下文章