若优先队列启发式合并MLE
查看原帖
若优先队列启发式合并MLE
537654
FS_NEO楼主2025/6/18 16:39

pop并不能真正地释放空间,可以使用一个非常高妙的swap方法:

void clear(){
	priority_queue<int>el;swap(l,el);
	priority_queue<int,vector<int>,greater<int> >er;swap(r,er);
}
2025/6/18 16:39
加载中...