"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as the following:

0. The Champion will receive a "Mystery Award" (such as a BIG collection of students' research papers...).
1. Those who ranked as a prime number will receive the best award -- the Minions (小黄人)!
2. Everyone else will receive chocolates.

Given the final ranklist and a sequence of contestant ID's, you are supposed to tell the corresponding awards.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (<=10000), the total number of contestants. Then N lines of the ranklist follow, each in order gives a contestant's ID (a 4-digit number). After the ranklist, there is a positive integer K followed by K query ID's.

Output Specification:

For each query, print in a line "ID: award" where the award is "Mystery Award", or "Minion", or "Chocolate". If the ID is not in the ranklist, print "Are you kidding?" instead. If the ID has been checked before, print "ID: Checked".

Sample Input:

6
1111
6666
8888
1234
5555
0001
6
8888
0001
1111
2222
8888
2222

Sample Output:

8888: Minion
0001: Chocolate
1111: Mystery Award
2222: Are you kidding?
8888: Checked
2222: Are you kidding?
 #include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<math.h>
using namespace std;
int tb[] = {}, N, K;
int isPrime(int n){
int sqr = sqrt(n * 1.0);
if(n == )
return ;
for(int i = ; i <= sqr; i++){
if(n % i == )
return ;
}
return ;
}
char str[][] = {"Are you kidding?", "Mystery Award", "Minion", "Chocolate", "Checked"};
int main(){
scanf("%d", &N);
int temp;
for(int i = ; i <= N; i++){
scanf("%d", &temp);
if(i == ){
tb[temp] = ;
}else if(isPrime(i) == ){
tb[temp] = ;
}else tb[temp] = ;
}
scanf("%d", &K);
for(int i = ; i < K; i++){
scanf("%d", &temp);
printf("%04d: %s\n", temp, str[tb[temp]]);
if(tb[temp] != )
tb[temp] = ;
}
cin >> N;
return ;
}

A1116. Come on! Let's C的更多相关文章

  1. PAT甲级——A1116 Come on! Let's C

    "Let's C" is a popular and fun programming contest hosted by the College of Computer Scien ...

  2. 玩玩LED点阵屏(arduino nano)

    做些记录,特别是led显示左移效果的代码,二进制位的特效函数 unsigned ][]= { 0xff,0xd7,0x83,0xd6,0xc6,0xd4,0xc6,0x82,0xd6,0xba,0xf ...

  3. 1116 Come on! Let's C (20 分)

    1116 Come on! Let's C (20 分) "Let's C" is a popular and fun programming contest hosted by ...

  4. ASP.NET MVC 使用 Datatables (1)

    具体步骤: 1.建立实体类 public class Asset { public System.Guid AssetID { get; set; } [Display(Name = "Ba ...

  5. PAT (Advanced Level) Practice(更新中)

    Source: PAT (Advanced Level) Practice Reference: [1]胡凡,曾磊.算法笔记[M].机械工业出版社.2016.7 Outline: 基础数据结构: 线性 ...

  6. PAT_A1116#Come on! Let's C

    Source: PAT A1116 Come on! Let's C (20 分) Description: "Let's C" is a popular and fun prog ...

随机推荐

  1. CSS自定义属性expression_r

    CSS的出现使网页制作者在对网页元素的控制方便许多,当然,有利必有弊,CSS只能对颜色.大小.距离等静态样式有效,对于要实现某些html元素的动态样式就显得有些力不从心.有了CSS的自定义属性expr ...

  2. linux ps命令用法

    -A    列出所有的进程-w    显示加宽可以显示较多的资讯-au    显示较详细的资讯-aux    显示所有包含其他使用者的行程 -A 显示所有进程(等价于-e)(utility)-a 显示 ...

  3. 命名自我规约manual

    前端: 所有文件命名都小写,多个单词连接使用 “-” 变量命名规则还是驼峰式,或者在前面加个 “_” SQL: MySQL: 所有命名都小写,无论库.表.还是字段等等,都小写 多个单词之间的分隔,使用 ...

  4. ERP行业内幕看了这五个问题全懂了

    ERP系统是现代企业实现信息化管理的必经之路.但很多管理人员或已经在用ERP的人员,其实并不太懂ERP系统是什么意思,有哪些好处等,导致实际使用过程中经常大材小用,或者“英雄无用武之地”.所以,为了更 ...

  5. ReadWriteLock读写锁(八)

    前言:在JUC ReentrantReadWriteLock是基于AQS实现的读写锁实现. ReadWriteLock中定义了读写锁需要实现的接口,具体定义如下: public interface R ...

  6. maven 当两个工程合并后 他的classpath也合并了

    maven   当两个工程合并后 他的classpath也合并了  也就是说资源文件环境合并了

  7. Android系统启动概要

    注:Java系统服务与本地系统服务标注反了 1.Linux内核 Android系统启动时,首先通过BootLoader(系统加载器)加载Linux内核,在Linux加载启动时,首先初始化内核,再调用i ...

  8. Python中的numpy模块解析

    numpy 1.  创建对象 维度(dimensions):轴 轴的个数:秩(rank) Numpy最重要的一个特点就是其N维数组对象(即ndarray) 创建数组最简单的函数就是用array函数: ...

  9. Hat’s Words HDU - 1247 字典树

    题意:给出数个单词 输出单词 如果该单词 是由字典中的单词组成的 思路:字典树 先把全部建树  然后对于每一个单词进行分割,分别拿两半到字典树里面去找 小心RE! #include<bits/s ...

  10. BZOJ4755 [JSOI2016]扭动的回文串 【后缀数组】【manacher】

    题目分析: 我写了史上最丑的后缀数组,怎么办? 首先manacher一遍两个串,这样只用考虑第三问.用$作为间隔符拼接两个串,把第一个串翻转.枚举回文中心,取最长的回文串,对于剩下的部分利用LCP匹配 ...