摘要: 第一章 基础算法:排序、高精度、二分、前缀和差分、双指针、位运算、离散化、区间合并 一、排序 快速排序 void quick_sort(int a[],int l,int r) { if(l>=r) return; int i = l-1,j = r+1;//初始化为左右边界外侧的原因:实现交换后向 阅读全文
posted @ 2022-03-11 23:43 安河桥北i 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1242. 修改数组 做法一:并查集变种 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 2e6; int p[N]; int n,x; int find(i 阅读全文
posted @ 2022-03-11 21:00 安河桥北i 阅读(19) 评论(0) 推荐(0) 编辑