题解
2025-07-10 21:23:29
发布于:新疆
6阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
struct node{
int w=0,l=0;
bool ui=0;
};
int n;
struct op{
int flag,t,cnt;
}a[105];
bool cmp(op a,op b){
if(a.cnt!=b.cnt) return a.cnt>b.cnt;
if(a.t!=b.t) return a.t<b.t;
return a.flag<b.flag;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
int m;
cin>>m;
a[i].flag=i;
node u[14];
for(int j=1;j<=m;j++){
int lo,fl,y;
cin>>lo>>fl>>y;
u[fl].l=lo;
u[fl].ui=y;
if(!u[fl].ui){
u[fl].w++;
}
}
for(int j=1;j<=13;j++){
if(u[j].ui){
a[i].t+=(u[j].l+u[j].w*15);
a[i].cnt++;
}
}
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
cout<<a[i].flag<<" ";
}
return 0;
}
这里空空如也
有帮助,赞一个