2022年4月22日
摘要: 归并排序O(nlong) 1 #include<bits/stdc++.h> 2 #define N 100010 3 using namespace std; 4 5 int n; 6 int a[N],tmp[N]; 7 void merge_sort(int l,int r) { 8 if(l 阅读全文
posted @ 2022-04-22 19:12 我疯故我在 阅读(14) 评论(0) 推荐(0)
摘要: 快速排序O(nlong) 1 #include<bits/stdc++.h> 2 #define N 100010 3 using namespace std; 4 5 int n; 6 int a[N]; 7 void qsort(int l,int r) { 8 if(l>=r) return; 阅读全文
posted @ 2022-04-22 19:06 我疯故我在 阅读(36) 评论(0) 推荐(0)
摘要: lower_bound(x)查找>=x的元素中最小的一个,并返回指向该元素的迭代器; upper_bound(x)查找>x的元素中最小的一个,并返回指向该元素的迭代器。 若要查找<x的元素中最大的一个,用lower_bound(a+1,a+n+1,m)-a-1;(返回>=m中的最小的一个,然后下标- 阅读全文
posted @ 2022-04-22 09:55 我疯故我在 阅读(39) 评论(0) 推荐(0)