文章目录
前言
- 前言
- Vector
- CODE
- Heap
- CODE
传送门 : 题解千奇百怪
Vector因为我们是需要输出 一个序列里面有序的中位数,显然我们不可能每次插入都进行一次排序 所以我们可以利用二分,索引下标之后再进行查找
CODE#include
using namespace std;
#define ll long long
#define endl '\n'
const int N = 10;
void cal()
{
}
void solve()
{
int n;cin>>n;
vector a;
for(int i=1;i>x;
a.insert(upper_bound(a.begin(),a.end(),x),x);
if(i%2 == 1){
coutx;
int mid = x;
cout
关注
打赏