题目链接

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3705

题意

给出N个队员 然后一个教练要从中选择 M名队员 要选最优的M名

然后根据这么来判断

IF做过的题目是属于 MaoMao Selection 那么 pts + 2.5

else IF属于 Old Surgeon Contest pts + 1.5

else IF 题目序号是素数 pts + 1

else pts + 0.3

IF 参赛的队伍获得一等奖 pts + 36

else IF 获得二等奖 pts + 27

else IF 获得三等奖 pts + 18

else pts + 0

参加 JapanJam 类的比赛 (计算rating)

用第三高的 rating 作为 r

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

计算这个式子 算得 要加的 pts

最后 如果这名队员是女生 pts + 33

输入:

先输入T 表示 T组数据

输入 N M 表示 N名队员 选 M个

输入 R 再有R个题目 序号 表示 这R个题目是 MaoMao Selection

输入 S 再有S个题目序号 表示 这 S个题目是 Old Surgeon Contest

输入 Q

接下来 Q 行

每行三个参数 string int

分别代表 队伍名称 获得的奖项序号

接下来 N 行

参数 string string char int int

表示 队员名称 所属的队伍名称 性别 所做的题目数量 和 参加的 japan 比赛次数

然后会列出 题目序号 以及 每次参加 japan 所获得的 rating

思路

大概 题意讲清,,就能 A了吧

对了 如果 rating 个数 不足三个 那么 pts + 0

AC代码

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<list>
#include<stack>
#include <queue> #define CLR(a, b) memset(a, (b), sizeof(a)) using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
const int INF = 0x3f3f3f3f;
const int maxn = 1e2 + 5;
const int MOD = 1e9; bool isprime(int x)
{
int m = sqrt(x) + 1;
for (int i = 2; i <= m; i++)
if (x % i == 0)
return false;
return true;
}
struct node
{
string name;
double score;
}; bool comp(int x, int y)
{
return x > y;
} bool cmp(node x, node y)
{
if (x.name == y.name)
return x.name < y.name;
return x.score > y.score;
} int main()
{
int t;
cin >> t;
while (t--)
{
map <int, int> mao, old;
int n, m;
scanf("%d%d", &n, &m);
int k;
scanf("%d", &k);
int num;
for (int i = 0; i < k; i++)
{
scanf("%d", &num);
mao[num] = 1;
}
scanf("%d", &k);
for (int i = 0; i < k; i++)
{
scanf("%d", &num);
old[num] = 1;
}
map <string, int> prize;
scanf("%d", &k);
string s;
for (int i = 0; i < k; i++)
{
cin >> s;
scanf("%d", &num);
if (num == 1)
prize[s] = 36;
else if (num == 2)
prize[s] = 27;
else if (num == 3)
prize[s] = 18;
else if (num == 0)
prize[s] = 0;
}
vector <node> ans;
char c;
for (int i = 0; i < n; i++)
{
node u;
u.score = 0.0;
cin >> u.name;
cin >> s;
u.score += prize[s];
scanf(" %c", &c);
if (c == 'F')
u.score += 33;
int v, w;
scanf("%d%d", &v, &w);
for (int i = 0; i < v; i++)
{
scanf("%d", &num);
if (mao[num])
u.score += 2.5;
else if (old[num])
u.score += 1.5;
else if (isprime(num))
u.score += 1;
else
u.score += 0.3;
}
vector <int> rat;
for (int i = 0; i < w; i++)
{
scanf("%d", &num);
rat.push_back(num);
}
if (rat.size() >= 3 )
{
sort(rat.begin(), rat.end(), comp);
u.score += (0, (rat[2] - 1200) * 1.0 / 100) * 1.5;
}
ans.push_back(u);
}
sort(ans.begin(), ans.end(), cmp);
for (int i = 0; i < m; i++)
{
cout << ans[i].name;
printf(" %.3lf\n", ans[i].score);
}
}
}

ZOJ - 3705 Applications 【模拟】的更多相关文章

  1. ZOJ 3705 Applications 模拟

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

  2. ZOJ 3705 Applications

    点我看题目 题意 : 真是一道又臭又长的模拟题啊,不过比赛的时候没看,赛完了补的. 给你N个候选人,让你从中选M个候选人,根据四个大规则来确定每个人的分数,然后选分数前M个人的输出. 1.在MOJ上做 ...

  3. Applications (ZOJ 3705)

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

  4. A - Jugs ZOJ - 1005 (模拟)

    题目链接:https://cn.vjudge.net/contest/281037#problem/A 题目大意:给你a,b,n.a代表第一个杯子的容量,b代表第二个杯子的容量,然后一共有6种操作.让 ...

  5. ZOJ 2610 Puzzle 模拟

    大模拟:枚举6个方向.检查每一个0是否能移动 Puzzle Time Limit: 2 Seconds      Memory Limit: 65536 KB Little Georgie likes ...

  6. Applications(模拟)

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3705 题意:主要是分值计算要注意以下几点: (1) 在MOJ上解出的题,如 ...

  7. Capture the Flag ZOJ - 3879(模拟题)

    In computer security, Capture the Flag (CTF) is a computer security competition. CTF contests are us ...

  8. ZOJ 3652 Maze 模拟,bfs,读题 难度:2

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4842 要注意题目中两点: 1.在踏入妖怪控制的区域那一刹那,先减行动力,然后才 ...

  9. [ZOJ 1009] Enigma (模拟)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1009 题目大意:给你三个转换轮,只有当第一个转换轮转动一圈后第二 ...

随机推荐

  1. 【VBA】VBA编写的,将一列中相同的内容的行提取出来单独生成文件

    数据如上图所示,点击RUN后的运行结果如下: 得到该文件夹,文件夹内容如上图. 代码如下: Private Sub Command_OLIVER() Dim arr arr = Range(" ...

  2. 阿里CI/CD、DevOps、分层自动化技术

    原文地址:http://www.infoq.com/cn/news/2017/01/alibaba-yunxiao-cicd-devops 在互联网时代,产品快速迭代的重要性不言而喻.不管是传统企业还 ...

  3. linux epoll机制对TCP 客户端和服务端的监听C代码通用框架实现

    1 TCP简介 tcp是一种基于流的应用层协议,其“可靠的数据传输”实现的原理就是,“拥塞控制”的滑动窗口机制,该机制包含的算法主要有“慢启动”,“拥塞避免”,“快速重传”. 2 TCP socket ...

  4. 【数据挖掘】分类之decision tree(转载)

    [数据挖掘]分类之decision tree. 1. ID3 算法 ID3 算法是一种典型的决策树(decision tree)算法,C4.5, CART都是在其基础上发展而来.决策树的叶子节点表示类 ...

  5. Vim使用技巧(1) -- 普通模式技巧 【持续更新】

    直观的来一张键盘图先 符号快捷键 . //重复上次修改 ^ //光标快速跳转到当前行开头 $ //光标快速跳转到当前行结尾 f{char} //光标快速跳转到当前行下一个{char}字符,{char} ...

  6. eclipse配置jp.gr.java_conf.ussiy.app.propedit_5.3.3

    配置PropertiesEditor插件 jp.gr.java_conf.ussiy.app.propedit_5.3.3   1.下载PropertiesEditor插件 http://pan.ba ...

  7. Centos date 设置自定义时间

    [1]手动修改 (1)设置日期 # date -s 20190315 (2)设置时间 # date -s 15:23:34 (3)设置日期和时间 # date -s "20190315 15 ...

  8. Oracle关于快速缓存区应用原理

    为什么oracle可以对于大量数据进行訪问时候能彰显出更加出色表现,就是通过所谓的快速缓存来实现数据的快速运算与操作.在之前的博文中我已经说过sql的运行原理,当我们訪问数据库的数据时候,首先不是从数 ...

  9. 基于HttpClient实现网络爬虫~以百度新闻为例

    转载请注明出处:http://blog.csdn.net/xiaojimanman/article/details/40891791 基于HttpClient4.5实现网络爬虫请訪问这里:http:/ ...

  10. 44.Android MD5Util

    44.Android MD5Util public class MD5Util { public static String getMD5String(String key) { char hexDi ...