1057 Stack (30 分)
传送门
1.用树状数组维护一个序列的中位数(求本质序列第K大问题)
2.二分
3.其修改和访问的时间复杂度都为O(lgn)
#include<bits/stdc++.h>
using namespace std;
stack<int > s;
const int maxn = 100010;
int a[maxn];
int lowbit(int i){
return i&(-i);
}
void updata(int pos,int val){
for(in
原创
2021-03-24 16:05:46 ·
40 阅读 ·
0 评论