点我看题目

题意 : 真是一道又臭又长的模拟题啊,不过比赛的时候没看,赛完了补的。

给你N个候选人,让你从中选M个候选人,根据四个大规则来确定每个人的分数,然后选分数前M个人的输出。

1、在MOJ上做过题的根据以下规则来计算加分:

  • 如果题目是MAOMAO中的,做对一道加2.5分
  • 如果题目是Old Surgeon Contest中的做对一个加1.5分,当然在MAOMAO中没有与Old Surgeon Contest中相同的题
  • 如果不是两个中的题,但是题号是素数的做对一道加1分
  • 如果不是上边三种情况中的任何一种,做对一道加0.3分。

2、 Marjar学校每年都会举办比赛,如果申请人中有得了奖的,一等奖加36分,二等奖加27分,三等奖加18分,否则加0分。

3、还有在别的OJ上做比赛的,会根据他们做的情况进行加分,如果在那些OJ上做的比赛超过三场的,取第三高的分数进行运算,pts =  max(0, (r - 1200) / 100) * 1.5,r 即第三高的分数,然后将pts加入到最后的得分中。

4、如果申请人是女生再多加上33分。

思路 :题意已经说的差不多了,接下来就可以模拟了。注意好细节就可以了。

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <map> using namespace std ; struct node
{
string name ;
double score ;
bool operator<(node a)const{
if(score == a.score)
return name < a.name ;
return score > a.score ;
}
}pt[] ; map<string,int>mapp ;
int Mao[] , OSC[] ,ss[]; int isprime(int n)
{
for(int i = ; i*i <= n ; i++)
if(n%i == )
return ;
return ;
}
int main()
{
int T,N,M,R,S,m,Q,n ;
scanf("%d",&T) ;
char nam[] ;
while(T--)
{
memset(Mao,,sizeof(Mao)) ;
memset(OSC,,sizeof(OSC)) ;
memset(ss,,sizeof(ss)) ;
mapp.clear() ;
scanf("%d %d",&N,&M) ;
scanf("%d",&R) ;
for(int i = ; i < R ; i++){scanf("%d",&m) ;Mao[m] = ;}
scanf("%d",&S) ;
for(int i = ; i < S ; i++){scanf("%d",&m) ; OSC[m] = ;}
scanf("%d",&Q) ;
for(int i = ; i < Q ; i++)
{
scanf("%s %d",nam,&m) ;
if(m == ) mapp[nam] += ;
else if(m == ) mapp[nam] += ;
else if(m == ) mapp[nam] += ;
else mapp[nam] += ;
}
char sex ;
for(int i = ; i < N ; i++)
{
cin >> pt[i].name>>nam>>sex>>m>>n ;
if(sex == 'M')
pt[i].score = ;
else pt[i].score = ;
pt[i].score += mapp[nam] ;
int id ;
for(int j = ; j < m ; j++)
{
scanf("%d",&id) ;
if(Mao[id]) pt[i].score += 2.5 ;
else if(OSC[id]) pt[i].score += 1.5 ;
else if(isprime(id)) pt[i].score += ;
else pt[i].score += 0.3 ;
}
for(int j = ; j < n ; j++) scanf("%d",&ss[j]) ;
if(n >= )
{
sort(ss,ss+n) ;
pt[i].score += max(0.0, (ss[n-] - ) / 100.0) * 1.5 ;
}
}
sort(pt,pt+N) ;
for(int i = ; i < M ; i++)
{
cout<<pt[i].name ;
printf(" %.3f\n",pt[i].score) ;
}
}
return ;
}

ZOJ 3705 Applications的更多相关文章

  1. ZOJ - 3705 Applications 【模拟】

    题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3705 题意 给出N个队员 然后一个教练要从中选择 M名队员 要选 ...

  2. ZOJ 3705 Applications 模拟

    #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include< ...

  3. Applications (ZOJ 3705)

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

  4. POJ 2418 ,ZOJ 1899 Hardwood Species - from lanshui_Yang

    Description Hardwoods are the botanical group of trees that have broad leaves, produce a fruit or nu ...

  5. Detect the Virus ZOJ - 3430 AC自动机

    One day, Nobita found that his computer is extremely slow. After several hours' work, he finally fou ...

  6. ZOJ People Counting

    第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...

  7. ZOJ 3686 A Simple Tree Problem

    A Simple Tree Problem Time Limit: 3 Seconds      Memory Limit: 65536 KB Given a rooted tree, each no ...

  8. Authorization in Cloud Applications using AD Groups

    If you're a developer of a SaaS application that allows business users to create and share content – ...

  9. DAC Usage3:Monitor Data-tier Applications

    If you deploy a DAC to a managed instance of the Database Engine, information about the deployed DAC ...

随机推荐

  1. [转载]PHP 字符串替换中文

    $a = "Car 神"; $result = preg_replace('/([\x80-\xff]*)/i','',$a); var_dump($result); 参考链接:p ...

  2. JDK Tools - jps: JVM 进程状态工具

    jps(Java Virtual Machine Process Status Tool) 是 JDK 提供的一个显示当前所有 Java 进程实例的命令. 命令格式 jps [ options ] [ ...

  3. c#结束winword.exe进程、

    最近在做一个c#生成word的功能.调用了微软自带的COM组件. 生成完以后发现有一个winword.exe无法关闭.调试或修改代码都没有搞明白.  遂强制关闭进程了. System.Diagnost ...

  4. viewpager双层嵌套,子viewpager无限循环无法手动滑动

    项目中首页是用viewpager+fragment集成的,第一个fragment有广告轮播图使用viewpager实现的,开始就遇到是广告图无法手动滑动,事件被外层的viewpager拦截响应切换到下 ...

  5. Sqlserver基于流程控制

    流程控制语句只能在单个批处理段,用户自定义函数和存储过程中使用不能夸多个批处理或者用户自定义函数或者存储过程 批处理:一个或者多个语句组成的一个批处理,是因为所有语句一次性地被提交到一个sql实例,如 ...

  6. C/C++雷区之内存管理

    C++雷区之内存管理 伟大的Bill Gates 曾经失言: 640K ought to be enough for everybody — Bill Gates 1981 程序员们经常编写内存管理程 ...

  7. 关于windows10调试应用注册失败

    搜索了一些方法,都是win8系统的应用程序解决方案,修改应用程序的包名.也尝试修改了一些,但是失败,任然报错,以前在这个机器上面是能正常调试的,唯一的不同点是就是系统升级到10166了,于是去设置里面 ...

  8. FancyBox——jQuery弹出窗口插件

    最近工作项目中有用到这款插件,就查找了一下相关资料和用法,下面是一些基本的简单用法,比较容易掌握,有需要的小伙伴可以参考.:) FancyBox是一款基于jquery开发的类Lightbox插件.支持 ...

  9. JSTL 入门

    JSTL--JSP Standard Tag Library--JSP标准标签函式库         当前版本 1.2.5     JSP 标准标签库(JSTL) JSP标准标签库(JSTL)是一个J ...

  10. 06_XML的写入_dom4j添加、删除、修改Xml文件内容

    [工程截图] [person.xml]准备一个xml文件 <?xml version="1.0" encoding="UTF-8"?> <st ...