cpp1

bbjx5 2024-11-24 20:13:42 3
#include<bits/stdc++.h>
using namespace std;
struct nide{
	string shool;
	string team;
	int solved;
	int time;
}a[200010];
bool cmp(nide x,nide y)
{
	if(x.solved!=y.solved) return x.solved>y.solved;
	else if(x.solved!=y.solved) return x.time<y.time; 
} 
int main()
{
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].shool>>a[i].team>>a[i].solved>>a[i].time;
		if(a[i].team[a[i].team.size()-1]!='*'&&a[i].solved>=1) sum++;
	}
	cout<<sum<<endl;
	int j=sum*(10/100);
	int y=sum*(30/100)-j;
	int t=sum*(60/100)-y-j;
	string s2;
	cin>>s2;
	sort(a+1,a+1+n,cmp);
	if(s2=="gold")
	{
		cout<<j<<endl;
		for(int i=1;i<=j;i++)
		{
			cout<<a[i].shool<<a[i].team<<a[i].solved<<a[i].time<<endl;
		}
	}
	else if(s2=="silver")
	{
		cout<<y<<endl;
		for(int i=j+1;i<=j+1+y;i++)
		{
			cout<<a[i].shool<<a[i].team<<a[i].solved<<a[i].time<<endl;
		}
	}
	else if(s2=="bronze")
	{
		cout<<t<<endl;
		for(int i=y+1;i<=y+1+t;i++)
		{
			cout<<a[i].shool<<a[i].team<<a[i].solved<<a[i].time<<endl;
		}
	}
	
	return 0;
}
/*
15
nanjingdaxue chuochuorangchuochuobie 9 1148
qinghuadaxue sangedinglia 11 1340
beijingdaxue nishizi 10 780
qinghuadaxue  miaomiaomiaomiaomiaomiaomiao 10 1126
xianjiaotongdaxue chabuduodele 10 1211
nanjingyoudiandaxue Cirtrus 10 1361
zhejiangdaxue SolitaryDream 8 788
tengxun tengxundaibiaodui* 8 842
kuangshi kuangshidaibiaodui* 8 1251
changchunligongdaxue dlrowollehstup 3 324
beijingdaxue chongshengzhiwoshicaigou 12 1036
beijingdaxue daidainiao 12 1230
qinghuadaxue sangedingxiang 12 2030
beijingdaxue chongshengcaigou 11 1523
beijingligongdaxue ddlzhanshen 10 1623
gold
*/

{{ vote && vote.total.up }}