摘要:
lower_bound( )和upper_bound( )都是利用二分查找的方法在一个排好序的数组中进行查找的。 在从小到大的排序数组中, lower_bound( begin,end,num):从数组的begin位置到end-1位置二分查找第一个大于或等于num的数字,找到返回该数字的地址,不存在 阅读全文
posted @ 2021-04-15 15:04
Acception
阅读(116)
评论(0)
推荐(0)
摘要:
merge函数的作用是:将两个已经排好序的序列合并为一个有序的序列。 函数参数:merge(first1,last1,first2,last2,result,compare); firs1t为第一个容器的首迭代器,last1为第一个容器的末迭代器; first2为第二个容器的首迭代器,last2为容 阅读全文
posted @ 2021-04-15 14:56
Acception
阅读(192)
评论(0)
推荐(0)
摘要:
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int maxn=1e5+10; int a[maxn<<4],lz[maxn]; void build(int k,int l,int r){ if( 阅读全文
posted @ 2021-04-15 13:33
Acception
阅读(34)
评论(0)
推荐(0)
摘要:
#include <bits/stdc++.h> using namespace std; const int maxn=1e5+100; int kmp[maxn]; int main() { char b[maxn]; scanf("%s",b+1); int j=0,lb=strlen(b+1 阅读全文
posted @ 2021-04-15 13:19
Acception
阅读(47)
评论(0)
推荐(0)
摘要:
#include<cstdio> #include<cstring> #include<algorithm> #define mid (l+r)/2 using namespace std; const int N = 200010; int n, q, m, cnt = 0; int a[N], 阅读全文
posted @ 2021-04-15 13:10
Acception
阅读(38)
评论(0)
推荐(0)

浙公网安备 33010602011771号