
二分
blue_sister
这个作者很懒,什么都没留下…
展开
-
//GPLT L2-2 三足鼎立
1.STL2.math3.lower_bound和upper_bound的底层是二分实现的#include<bits/stdc++.h>using namespace std;#define ll long longll a[200005];int main(){ ll n,v; scanf("%lld%lld",&n,&v); for(int i=0;i<n;i++) scanf("%lld",&a[i])原创 2021-04-19 19:10:32 · 284 阅读 · 0 评论 -
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 · 65 阅读 · 0 评论