传送门 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n; long long a[100005]; inline void quick_sort(int l,int r) { int i = l , j = r ; int mid = a[(l + r ) / 2]; while(i<=j) { wh…
这道题用传统快排(如下所示)的结果就是最后三个点TLE: void swap(int &a, int &b) { int tmp = a; a = b; b = tmp; } void quickSort(int a[], int left, int right) { if (left >= right) return; int i = left, j = right; while (i < j) { while (j > i && a[j] >=…