摘要:
作用 在求一串数的Sn - Sm 时,降低时间复杂度O(n)为O(1) 代码 #include<iostream> using namespace std; const int N = 100010; int n, m; int a[N], s[N]; int main() { scanf("%d% 阅读全文
摘要:
#include<iostream> using namespace std; const int N = 100010; int tmp[N]; void merge_sort(int q[], int l, int r) { if (l >= r)return; int mid = l + r 阅读全文
摘要:
void swap(int a, int b) { int c = a; a = b; b = c; } void quick_sort(int q[], int l, int r)//L从0开始 { if (l >= r)return; int i = l - 1, j = r + 1, x = 阅读全文