1 条题解
-
1
#include<bits/stdc++.h> using namespace std; int n; long long tt; struct node{ string name; int last, clas; char guan, west; int talk; int tot; int num; }st[100005]; bool cmp(node a, node b){ if(a.tot!=b.tot){ return a.tot>b.tot; } return a.num<b.num; } int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>st[i].name>>st[i].last>>st[i].clas>>st[i].guan; cin>>st[i].west>>st[i].talk; st[i].num=i; if(st[i].last>80&&st[i].talk>0){ st[i].tot+=8000; tt+=8000; } if(st[i].last>85&&st[i].clas>80){ st[i].tot+=4000; tt+=4000; } if(st[i].last>90){ st[i].tot+=2000; tt+=2000; } if(st[i].last>85&&st[i].west=='Y'){ st[i].tot+=1000; tt+=1000; } if(st[i].clas>80&&st[i].guan=='Y'){ st[i].tot+=850; tt+=850; } } sort(st, st+n, cmp); cout<<st[0].name<<"\n"; cout<<st[0].tot<<"\n"; cout<<tt; }
- 1
信息
- ID
- 5109
- 时间
- 1000ms
- 内存
- 125MiB
- 难度
- 2
- 标签
- 递交数
- 52
- 已通过
- 35
- 上传者