SDOI
来源:互联网 发布:优雅的淘宝收件人名字 编辑:程序博客网 时间:2024/06/16 04:44
The Annual National Olympic of Information(NOI) will be held.The province of Shandong hold a Select(which we call SDOI for short) to choose some people to go to the NOI.
According to the tradition and regulation.There were two rounds of the SDOI, they are so called "Round 1" and "Round 2", the full marks of each round is
All the n people take part in Round1 and Round2, now the original mark of every person is known. The rule of SDOI of ranking gets to the "standard mark". For each round there is a highest original mark,let's assume that is
After we got everyone's final mark in both round.We calculate the Ultimate mark of everyone as
After we got everyone's Ultimate mark.We choose the persons as followed:
To encourage girls to take part in the Olympic of Information.In each province,there has to be a girl in its teams.
1. If there is no girls take part in SDOI,The boys with the rank of first m enter the team.
2. If there is girls, then the girl who had the highest score(compared with other girls) enter the team,and other(boys and other girls) m-1 people with the highest mark enter the team.
Just now all the examination had been finished.Please write a program, according to the input information of every people(Name, Sex ,The original mark of Round1 and Round2),Output the List of who can enter the team with their Ultimate mark decreasing.
For each testcase, there are two integers
Followed
210 8dxy male 230 225davidwang male 218 235evensgn male 150 175tpkuangmo female 34 21guncuye male 5 15faebdc male 245 250lavender female 220 216qmqmqm male 250 245davidlee male 240 160dxymeizi female 205 1902 1dxy male 300 300dxymeizi female 0 0
The member list of Shandong team is as follows:faebdcqmqmqmdavidwangdxylavenderdxymeizidavidleeevensgnThe member list of Shandong team is as follows:dxymeiziHintFor the first testcase: the highest mark of Round1 if 250,so every one's mark times(300/250)=1.2, it's same to Round2.The Final of The Ultimate score is as followedfaebdc 298.20qmqmqm 295.80davidwang 275.88dxy 271.80lavender 260.64dxymeizi 233.40davidlee 220.80evensgn 201.00tpkuangmo 29.88guncuye 14.40For the second testcase,There is a girl and the girl with the highest m
题目大意:(zz博主翻译不好。。。)
一年一度的全国信息学奥林匹克竞赛(NOI)即将举办,SD省组织进行了一次省队选拔,一共有 n(n≤100)名选手参加了这次省队选拔。今年,SD省的省队名额为 m(m≤50) 人,即,今年的SD省队有 m 名队员。按照惯例,SD省的省队选拔有两轮比赛,依次为“Round1”和“Round2”,每个Round的满分为 300 分。所有 n 名选手都参加了Round1和Round2,现在每名选手Round1和Round2的“原始得分”已经确定。SD省的省队选拔采用标准分计算方式,即,设某个Round的最高原始得分为 x 分(保证每轮比赛都不会全场零分,即x>0),那么此Round每名选手的“相对得分”为: 这名选手此Round的原始得分∗(300/x)。所有选手的Round1和Round2的相对得分计算完毕后,将计算每名选手的“最终成绩”。一名选手的最终成绩为:这名选手的Round1相对得分∗0.3 + 这名选手的Round2相对得分∗0.7。非常和谐的是,保证不存在两名选手的最终成绩相等。所有选手的最终成绩计算完毕后,将会按照以下规则选出省队队员:为了鼓励女生参加信息学奥赛及相关活动,在有女选手参加省队选拔的情况下,省队中有一个固定的女选手名额。1)若没有女选手参加省队选拔,则最终成绩最高的 m 位选手进入省队。2)若有女选手参加省队选拔,则最佳女选手(女选手中最终成绩最高者)进入省队,其余的选手(男选手和最佳女选手之外的女选手)中成绩最高的 m−1 位选手进入省队。现在已经到了省队选拔的最后阶段,请你编写一个程序,根据输入的所有选手的信息(姓名,性别,Round1和Round2的原始得分),输出进入省队的选手的姓名,输出的姓名按照省队队员的最终成绩降序(从高到低)排列。
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;struct node {char a[100];char b[100];double c;double d;double e;}s[1010];bool cmp(node x,node y){return x.e>y.e;}int main(){int m,n,i,j,t;scanf("%d",&t);while(t--){j=0;bool ans=true;double max1=0.0,max2=0.0,max3=0.0;scanf("%d %d",&n,&m);for(i=0;i<n;i++){scanf("%s %s %lf %lf",s[i].a,s[i].b,&s[i].c,&s[i].d);if(!strcmp(s[i].b,"female"))ans=false;if(max1<s[i].c)max1=s[i].c;if(max2<s[i].d)max2=s[i].d;}for(i=0;i<n;i++){s[i].e=0.3*s[i].c*(300.0/max1)+0.7*s[i].d*(300.0/max2);if(!strcmp(s[i].b,"female")){if(s[i].e>max3){max3=s[i].e;}}}sort(s,s+n,cmp);printf("The member list of Shandong team is as follows:\n");if(ans){for(i=0;i<m;i++) { printf("%s\n",s[i].a); }}else{for(i=0;i<n;i++){if(s[i].e==max3)j=i;}if(max3>=s[m-1].e && !ans){for(i=0;i<m;i++){printf("%s\n",s[i].a);}}else {for(i=0;i<m-1;i++){printf("%s\n",s[i].a);}printf("%s\n",s[j].a);}}}return 0;}
- SDOI
- SDOI
- SDOI
- 5499 SDOI
- hdu5499 SDOI
- SDOI 游记
- 【SDOI 2011】打地鼠
- sdoi末日传说
- SDOI省选总结
- 2010 SDOI 大陆争霸
- SDOI(模拟)
- HDU 5499 SDOI
- HDU 5499 SDOI
- hdoj 5499 SDOI 【拼手速】
- hdu 5499 SDOI(水)
- HDOJ 5499 SDOI (乱搞)
- 杭电5499 SDOI
- HDOJ 5499 SDOI
- nohup
- JAVA 中 Redis与ehcache对比与使用
- 回溯法 求一个子集问题:装载问题、最大团问题
- shiro的简介
- SICP 2.38 研究递归和迭代模型
- SDOI
- ehcache详细解读
- android 加密算法与安全
- zookeeper算法研究
- [05]项目实战-PC 端固定布局(5)
- 仿微信小程序多任务栈效果
- lasticsearch 入门:Filebeat 安装及输出数据到 elasticsearch 或 logstash
- ListView滑动item卡片式推进动画效果
- JavaScript 执行上下文和变量对象