摘要:
这道题的数据范围比较突出: 1<=N<=1e9 先写一个O(N)算法: #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #define int long long using namespa 阅读全文
摘要:
算出两个数字的坐标,然后返回曼哈顿距离。 #include <iostream> #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> using namespace std; int w, m, n, 阅读全文
摘要:
1.以i为基准,且不带选取中位数的写法 // 从小到大 void quick_sort(int q[], int l, int r) { if(l >= r) return; int i = l - 1, j = r + 1, x = q[l + r + 1 >> 1];//注意是向上取整,因为向下 阅读全文