正文
增加 4 行删除 4 行
12345611 行未改动1819202122232425267 行未改动34353637383940414243444546477 行未改动## 此题为 P2073 代码_(感谢zhengrunzhe大佬的题解)_1.可以用重载运算符来重载默认的顺序2.可以用 erase((类型名){成员}); 来删除元素11 行未改动bool operator < (const fe x)const{if(c==x.c) return 0;return c>x.c;}};struct fc{ll w,c;bool operator < (const fc x)const{if(c==x.c) return 0;7 行未改动scanf("%lld%lld",&w,&c);se.insert((fe){w,c});sc.insert((fc){w,c});}if(ord==2){//删贵的ll pw=se.begin()->w,pc=se.begin()->c;se.erase(*se.begin());sc.erase((fc){pw,pc});}if(ord==3){//删便宜的ll pw=sc.begin()->w,pc=sc.begin()->c;sc.erase(*sc.begin());se.erase((fe){pw,pc});}7 行未改动12345611 行未改动1819202122232425267 行未改动34353637383940414243444546477 行未改动## 此题为 P2073 代码_(感谢zhengrunzhe大佬的题解)_1.可以用重载运算符来重载默认的顺序2.可以用 erase((类型名){成员}); 来删除元素11 行未改动bool operator < (const fe x)const{if(c==x.c) return 0;return c>x.c;}};struct fc{ll w,c;bool operator < (const fc x)const{if(c==x.c) return 0;7 行未改动scanf("%lld%lld",&w,&c);se.insert((fe){w,c});sc.insert((fc){w,c});}if(ord==2){//删贵的ll pw=se.begin()->w,pc=se.begin()->c;se.erase(*se.begin());sc.erase((fc){pw,pc});}if(ord==3){//删便宜的ll pw=sc.begin()->w,pc=sc.begin()->c;sc.erase(*sc.begin());se.erase((fe){pw,pc});}7 行未改动