zoj 3705 Applications

My Country and My People PDF版My Country and My People。 立即下载
Applications

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC competitions of the next season. As a traditional elite university in ACM/ICPC, there is no doubt that application forms will fill up the mailbox. To constitute some powerful teams, coaches of the ACM/ICPC team decided to use a system to score all applicants, the rules are described as below. Please note that the score of an applicant is measured by pts, which is short for "points".

1. Of course, the number of solved ACM/ICPC problems of a applicant is important. Proudly,Marjar University have a best online judge system called Marjar Online Judge System V2.0, and in short, MOJ. All solved problems in MOJ of a applicant will be scored under these rules:

  • (1) The problems in a set, called MaoMao Selection, will be counted as 2.5 pts for a problem.
  • (2) The problems from Old Surgeon Contest, will be counted as 1.5 pts for a problem.There is no problem in MaoMao Selection from Old Surgeon Contest.
  • (3) Besides the problem from MaoMao Selection and Old Surgeon Contest, if the problem's id is a prime, then it will be counted as 1 pts.
  • (4) If a solved problem doesn't meet above three condition, then it will be counted as 0.3 pts.

2. Competitions also show the strength of an applicant. Marjar University holds the ACM/ICPC competition of whole school once a year. To get some pts from the competition, an applicant should fulfill rules as below:

  • The member of a team will be counted as 36 pts if the team won first prize in the competition.
  • The member of a team will be counted as 27 pts if the team won second prize in the competition.
  • The member of a team will be counted as 18 pts if the team won third prize in the competition.
  • Otherwise, 0 pts will be counted.

3. We all know that some websites held problem solving contest regularly, such asJapanJam, ZacaiForces and so on. The registered member of JapanJam will have a rating after each contest held by it. Coaches thinks that the third highest rating inJapanJam of an applicant is good to show his/her ability, so the scoring formula is:

Pts = max(0, (r - 1200) / 100) * 1.5

Here r is the third highest rating in JapanJam of an applicant.

4. And most importantly - if the applicant is a girl, then the score will be added by 33 pts.

The system is so complicated that it becomes a huge problem for coaches when calculating the score of all applicants. Please help coaches to choose the bestM applicants!

Input

There are multiple test cases.

The first line of input is an integer T (1 ≤ T ≤ 10), indicating the number of test cases.

For each test case, first line contains two integers N (1 ≤ N ≤ 500) - the number of applicants andM (1 ≤ M ≤ N) - the number of members coaches want to choose.

The following line contains an integer R followed by R (0 ≤R ≤ 500) numbers, indicating the id of R problems in MaoMao Selection.

And then the following line contains an integer S (0 ≤ S ≤ 500) followed byS numbers, indicating the id of S problems from Old Surgeon Contest.

The following line contains an integer Q (0 ≤ Q ≤ 500) - There areQ teams took part in Marjar University's competition.

Following Q lines, each line contains a string - team name and one integer - prize the team get. More specifically, 1 means first prize, 2 means second prize, 3 means third prize, and 0 means no prize.

In the end of each test case, there are N parts. In each part, first line contains two strings - the applicant's name and his/her team name inMarjar University's competition, a char sex - M for male, F for female and two integersP (0 ≤ P ≤ 1000) - the number of problem the applicant solved,C (0 ≤ C ≤ 1000) - the number of competitions the applicant have taken part inJapanJam.

The following line contains P integers, indicating the id of the solved problems of this applicant.

And, the following line contains C integers, means the rating for C competitions the applicant have taken part in.

We promise:

  • The problems' id in MaoMao Selection, Old Surgeon Contest and applicant's solving list are distinct, and all of them have 4 digits (such as 1010).
  • All names don't contain spaces, and length of each name is less than 30.
  • All ratings are non-negative integers and less than 3500.

Output

For each test case, output M lines, means that M applicants and their scores. Please output these informations by sorting scores in descending order. If two applicants have the same rating, then sort their names in alphabet order. The score should be rounded to 3 decimal points.

Sample Input
1
5 3
3 1001 1002 1003
4 1004 1005 1006 1007
3
MagicGirl!!! 3
Sister's_noise 2
NexusHD+NexusHD 1
Edward EKaDiYaKanWen M 5 3
1001 1003 1005 1007 1009
1800 1800 1800
FScarlet MagicGirl!!! F 3 5
1004 1005 1007
1300 1400 1500 1600 1700
A NexusHD+NexusHD M 0 0


B None F 0 0


IamMM Sister's_noise M 15 1
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015
3000
Sample Output
FScarlet 60.000
IamMM 44.300
A 36.000


水题一枚啊,敲的时候只应一变量名写错,就这么错过银牌了,注定我的ACM之路不完整了。。。

#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
const double eps=1e-8;
const int N=10000;
map<string,int> m1;
struct node{
	char name[30];
	double rate;
	bool operator<(node x)const{
		if(fabs(rate-x.rate)>eps)return rate>x.rate;
		return strcmp(name,x.name)<0;
	}
}p[500];
bool prim[N];
int v[N],sc[500];
bool J(int x){
	if(x==0||x==1)return 0;
	int i,k=(int)sqrt(1.0*x);
	for(i=2;i<=k;i++)if(x%i==0)return 0;
	return 1;
}
int main(){
	int T,i,j,R,S,Q,x,n,m;
	char team[30],sex[2];
	for(i=0;i<N;i++)prim[i]=J(i);
	scanf("%d",&T);
	while(T--){
		scanf("%d%d",&n,&m);
		memset(v,0,sizeof(v));m1.clear();
		scanf("%d",&R);while(R--)scanf("%d",&x),v[x]=1;
		scanf("%d",&S);while(S--)scanf("%d",&x),v[x]=2;
		scanf("%d",&Q);while(Q--)scanf("%s%d",team,&x),m1[team]=x;
		for(i=0;i<n;i++){
			scanf("%s%s%s%d%d",p[i].name,team,sex,&R,&S);
			if(sex[0]=='M')p[i].rate=0;
			else p[i].rate=33;
			if(m1[team]==1)p[i].rate+=36;
			else if(m1[team]==2)p[i].rate+=27;
			else if(m1[team]==3)p[i].rate+=18;
			while(R--){
				scanf("%d",&x);
				if(v[x]==1)p[i].rate+=2.5;
				else if(v[x]==2)p[i].rate+=1.5;
				else {
					if(prim[x])p[i].rate+=1;
					else p[i].rate+=0.3;
				}
			}
			for(j=0;j<S;j++)scanf("%d",sc+j);
			sort(sc,sc+S);
			if(S>2)p[i].rate+=max(0.0,(sc[S-3]-1200)/100.0)*1.5;
		}
		sort(p,p+n);
		for(i=0;i<m;i++)printf("%s %.3lf\n",p[i].name,p[i].rate);
	}
	return 0;
}


 

Peace and Friendship 关于和平与友谊的一个ppt,自己亲手制作,敬请放心使用。 立即下载

相关推荐

AS7341光谱传感器实战:如何用STM32F103精准测量环境色温(附完整代码)

本文详细介绍了如何使用STM32F103驱动AS7341光谱传感器实现环境色温的精准测量。从硬件连接到驱动开发,再到色温计算算法的实现,提供了完整的代码示例和优化建议,帮助开发者在智能照明、农业监测等领域快速应用AS7341进行高精度色温检测。

weixin_30352645的博客 477

ZOJ - 3710 Friends

题目链接 题意:有n个人和m对朋友,其中两个人如果有k个共同好友,那么这两个人在一段时间之后会成为好友。 题记:题目给出的是足够的时间,那么就要一直跟新,直到没有两个人可以成为好友为止。用类似邻接矩阵的方式存下两个人的关系。a[i][j]表示i个j是好友,由于好友是双向的,所以a[j][i]也要存。 之后枚举所有人,然后记录下两个人之间有多少个共同好友,超过k个时要记录下两个人成为好友。 #inc...

moyangxian 197

非易失存储器读写

24C256、IIC_SCL、IIC_SDA

CT_1104的专栏 2985

ZOJ - 3705 Applications 模拟

题目: Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC competitions of the next season. As a traditional elite university i...

zamaochick的博客 255

Zlib1.2.11源码编译(Win10+VS2019)

下载 下载网址: zlib Home Site 得到文件: 解压缩到“D:\SourceCodes\zlib-1.2.11” 使用CMake配置、生成并打开项目 将CMakeLists.txt拖入CMake,配置(Configure): 生成(Generate) 打开项目(Open Project),CMake调用VS2019打开项目 生成debug版本 构建项目ALL_BUILD。成功生成debug版本 在“D:\Sourc...

Alexabc3000的专栏 1893

OpenAI Realtime API实时语音交互实战指南

实时语音交互是人机自然对话的核心能力,其本质在于构建低延迟、双向、流式协同的音频-语义闭环。它突破传统REST API的请求-响应范式,依托WebSocket实现毫秒级音频输入流(audio.delta)、模型生成流(text/audio.delta)与动态控制流(session.update)三重并行。该技术显著降低端到端延迟至300ms以内,支撑语音助手、智能客服、对话式教育等强实时场景。本文聚焦OpenAI Realtime API的工程落地,详解PCM音频流处理、VAD语音活动检测、AudioCon

weixin_32285357的博客 393

A - Applications ZOJ - 3705

Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC competitions of the next season. As a traditional elite university in ACM...

dreamjay1997的博客 303

【ShaderToy】开篇

写在前面呜呼,好久没有写博客了,好惭愧。题外话,感觉越大就越想家,希望可以一直和家人在一起,哪怕只是坐在一起不说话也觉得很温暖,一想到要分开眼睛就开始酸,哎。开学还是爬上来老实更新博客学习吧~今天爬上来一看,发现优快云的博客编辑终于更新了!进步总是好的,以前的编辑器实在很捉急。使用这种标记语言的确方便了很多,但好像颜色字体没法设置?程序员果然对美观没什么追求。ShaderToy如果你还没听过Sha

candycat 8万+

ZOJ--3710--Friends--二维数组模拟建立关系

题目链接https://vjudge.net/problem/ZOJ-3710 题目大意是输入朋友关系对,双方拥有共同朋友达到数量k之后可以变成朋友。求一段时间后有多少对新的朋友对关系建立起来。 要点: 1、建立friends[from][to]二维数组存储关系对。 2、注意新建立的朋友关系可能会连锁反应建立更多的好友关系。 代码如下: #include #include us

话歪之地的博客 399

深信服桌面云实战:从零部署到高效运维的配置全景指南

本文详细介绍了深信服桌面云从零部署到高效运维的全流程配置指南,涵盖硬件规划、平台部署、虚拟桌面发布、终端管理及性能优化等关键环节。特别强调了双万兆网络架构、分布式存储配置和智能调度功能的应用,帮助用户实现高性能、高可用的虚拟桌面环境。

weixin_28568819的博客 399

MTK Linux DRM分析(十一)- MTK KMS Panel显示屏驱动

面板扩展(Panel Extension)是指 MediaTek 在标准 DRM 面板驱动框架之上添加的定制化功能模块。

iTom1900 1684

ZOJ3705 Applications

ZOJ3705 Applications

qq_44919369的博客 170

基于转录逆转的药物重定向 GPS 模型

GPS是一个基于分子结构预测基因表达扰动的开源平台,由三个模块组成:RCL(在LINCS扰动数据上训练抗噪MLP)、GPS4Drugs(预测新化合物的基因表达谱并进行逆转评分)、MolSearch(基于MCTS的分子优化)。平台使用Morgan指纹和Gene Ontology注释作为特征输入,将基因表达扰动离散为三分类标签。训练数据来自LINCS Phase I的18,746个化合物和978个landmark基因,支持四细胞系独立训练,可用于药物重定向与化合物筛选。

听雨草堂 83

ZOJ3705:Applications

Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC competitions of the next season. As a traditional elite university in ACM

ACM!荣耀之路! 3万+

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

ZOJ 3705 Applications 模拟

题目的描述非常好理解。 不算难的模拟题,也没有坑,思路清晰即可。 (某丁学长在前年省赛时萎在这道模拟,其实好好想还是可以A 的 //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include &...

weixin_30318645的博客 129

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

ZOJ - 3705 Applications 【模拟】

题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3705 题意 给出N个队员 然后一个教练要从中选择 M名队员 要选最优的M名 然后根据这么来判断 IF做过的题目是属于 MaoMao Selection 那么 pts + 2.5 else IF属于 Old...

banshen0201的博客 199

ZOJ3705Applications

Applications Time Limit: 2 Seconds      Memory Limit: 65536 KB Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC c

Keep__Going 906

Applications(ZOJ3705)

题目链接:http://icpc.moe/onlinejudge/showProblem.do?problemCode=3705 很长的一道模拟题,其实题目很简单 题目大意如下:现在一个HR需要从这么多的application里边选出m个最优秀的人。然后给定一系列的规则。 1.刷题量,mao_mao库的一题2.5分,old库的一题1.5分,题号如果是素数一题1分,其余的按0.3分算 2.校

Linnnnnger的博客 603

Applications (ZOJ 3705)

题解:就是题目有点小长而已,可能会不想读题,但是题意蛮好理解的,就是根据条件模拟,计算pts。(送给队友zm、 qsh,你们不适合训练了。) #include &lt;iostream&gt; #include &lt;algorithm&gt; #include &lt;cstdio&gt; #include &lt;cstdlib&gt; #include &lt;cstring&gt; ...

Mercury_Lc的博客 416

ZOJ 3705 Applications

ZOJ 3705 Applications

Dacc123的博客 624

zoj 3705 Applications(较复杂的模拟)

1、http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3705 2、题目大意: 有

sdjzping的专栏 1571

ZOJ-3705-Applications

大模拟,注意1.5*max(0.0, 1.0*(a[2]-1200)/100)这里,如果是int a[ ] 的不要 /100, 要 *0.01 #include #include #include #include #include #include #include #include #include #include #define rtl rt<<1 #define r

Stone的博客 298
上一篇: zoj 3601 Unrequited Love
下一篇: 金山西山居初赛第一场
libing923
博客等级 码龄15年 12粉丝 71原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值