![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
J__lxj
这个作者很懒,什么都没留下…
展开
-
poj2018 Best Cow Fence(蓝书刷题记录)
一个正整数数列 A 求一个平均数最大的长度不小于L 的子段。 二分平均数,将原数列A每一项减去mid。有大于0的字段则移左端点,否则移动右端点。 #include<bits/stdc++.h> using namespace std; const double esp=1e-5; const int MAXN=1000000; int n,L; double a[MAXN],pre[...原创 2019-03-01 21:29:15 · 247 阅读 · 0 评论 -
hluoj 192 A-B problem
题目描述:给出一串数以及一个数字C,要求计算出所有A-B=C的数对的个数。(不同位置的数字一样的数对算不同的数对) 题解:A-C=B 先排序,保证具有一定的单调性。 也就是在序列中的每一个A,找到大于等于 A-C 的位置和大于A-C的位置,就是A-C=B 的个数。 比如: C=1 1 2 3 4 5 6 7 8 9 1 4 5 7 7 7 8 10 12 对于 8 来说 第一个大于 8-1 的...原创 2019-03-03 16:42:37 · 292 阅读 · 0 评论 -
blog
https://blog.csdn.net/yuzhong9208/article/details/78137433转载 2019-05-05 15:57:07 · 94 阅读 · 0 评论