二维向量快速排序
void sort(int left, int right, vector<int>& w, vector<int>& h)
{
if(left >= right) return;
int i = left;
int j = right;
int wl = w[left];
int hl = h[left];
while(i < j)
{
// cout << i << " " << j << " " << left << endl;
while(i < j && cmp(wl, hl, j)) j--;
w[i] = w[j];
h[i] = h[j];
while(i < j && !cmp(wl, hl, i)) i++;
w[j] = w[i];
h[j] = h[i];
}
// cout << 1 << endl;
w[i] = wl;
h[i] = hl;
sort(left, i-1, w, h);
sort(i+1, right, w, h);
}
bool cmp(int wl, int hl, int i)
{
if(wl < w[i]) return true;
if(wl > w[i]) return false;
if(hl > h[i]) return true;
else return false;
}