https://www.luogu.org/problem/show?pid=1168
维护两个堆,一个大根堆L维护小于等于mid的数,一个小根堆R维护大于等于mid的数,mid是上次输出的中位数
然后进行调整即可
#include#include #include #include #define ms(i,j) memset(i,j, sizeof i);using namespace std;int n;priority_queue L;//bigpriority_queue
本文共 810 字,大约阅读时间需要 2 分钟。
https://www.luogu.org/problem/show?pid=1168
维护两个堆,一个大根堆L维护小于等于mid的数,一个小根堆R维护大于等于mid的数,mid是上次输出的中位数
然后进行调整即可
#include#include #include #include #define ms(i,j) memset(i,j, sizeof i);using namespace std;int n;priority_queue L;//bigpriority_queue
转载于:https://www.cnblogs.com/flyinthesky1/p/6384241.html