![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
stl
yxr0105
这个作者很懒,什么都没留下…
展开
-
hoj3269
题意:前n-1个数有序,问第n个数可以插入的位置的下标范围。 题解:水题。但是掌握一下 lower_bound 和 upper_bound 嘛。//a 升序int l=lower_bound(a+1,a+1+n,v)-a;//返回第一个大于等于v的指针。int r=upper_bound(a+1,a+1+n,v)-a;//返回第一个大于v的指针。//a 降序#include<function原创 2017-11-09 18:53:14 · 203 阅读 · 0 评论 -
hoj3271
题意:nth_element 题解:stl中nth_element函数或者(伪)快排? nth_element(array, array+k, array+len); #include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;#define N 10000005#define ll long long原创 2017-11-09 18:58:51 · 190 阅读 · 0 评论