L2-021. 点赞狂魔
赞赞赞!!!!!!
#include<bits/stdc++.h>
using namespace std;
struct mp{
string s;
int k;
double g;
} m[1000];
bool cmp(struct mp a, struct mp b) {
if(a.k != b.k)
return a.k > b.k;
else return a.g < b.g;
}
set<int> se;
int main()
{
string s;
int n;
scanf("%d",&n);
for(int i = 0; i < n; i++){
getchar();
cin >> s;
int k;
long long sum = 0;
scanf("%d",&k);
for(int j = 0; j < k; j++) {
int c;
scanf("%d",&c);
se.insert(c);
}
m[i].s = s;
m[i].k = se.size();
m[i].g = k*1.0/m[i].k;
se.clear();
}
sort(m, m+n, cmp);
if(n >= 3) cout << m[0].s << " " << m[1].s << " " << m[2].s << endl;
else if(n >= 2) cout << m[0].s << " " << m[1].s << " -" << endl;
else if(n >= 1) cout << m[0].s << " -" << " -" << endl;
else cout << "- - -" << endl;
return 0;
}