按照4种方式排序
每次查询都对四种方式分别查询
然后比较
(注:博客作为交流使用,切勿抄袭应付作业)
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn = 233;
int n, m;
struct node {
int id;
int au, al, p;
double d1, d2;
}a[maxn], b[maxn], c[maxn], d[maxn];
bool cmp1(node a, node b) {
if(a.au == b.au) return a.id < b.id;
return a.au > b.au;
}
bool cmp2(node a, node b) {
if(a.al == b.al) return a.id < b.id;
return a.al > b.al;
}
bool cmp3(node a, node b) {
return a.d1 > b.d1;
}
bool cmp4(node a, node b) {
return a.d2 > b.d2;
}
//bool cmp3(node a, node b) {
// if(a.au*b.p == a.p*b.au) return a.id < b.id;
//