"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. Git本地仓库push至GitHub远程仓库每次输入账户密码问题解决(亲测可行)

    在使用git push命令将本地仓库内容推送至GitHub远程仓库的每一次git都要让我们输入GitHub的用户名和密码.这着实让我们心烦.我们会有疑问,我明明设置了公钥呀!怎么还需要输入账户和密码? ...

  2. js关闭当前页

    /*关闭当前页*/ function closeCurrentPage() { var userAgent = navigator.userAgent; if (userAgent.indexOf(& ...

  3. 《笔记》Python itertools的groupby分组数据处理

    今天遇到这么一个需求,需要将这样的数据进行分组处理: [(, ), (, ), (, ), (, ), (, ), (, )] 处理之后我可能需要得到这样的结果: [(, (, , (, , (, ) ...

  4. vue樣式綁定

    vue的樣式可以使得class,style不僅可以綁定文本,而且可以綁定數組和對象. 使用對象{} 使用數組 綁定對象 使用computed屬性, 使用內聯樣式.

  5. 中断MSI INTA

    转载https://blog.csdn.net/huangkangying/article/details/11178425 MSI VS INTx(Pin-based interrupt) MSI的 ...

  6. over-relaxation

    逐次超松弛sor 参考1https://blog.csdn.net/lusongno1/article/details/68941137 有各种对比和程序 主要就是取了加权平均,没仔细看

  7. Freemake Video Converter视频转换软件下载地址及去广告

    下载地址:http://download.freemake.net/FreemakeOriginals2/LS/FreemakeVideoConverterFull.exe 去片头及片尾广告:删除安装 ...

  8. JVM深入理解<二>

    以下内容来自: http://www.jianshu.com/p/ac7760655d9d JVM相关知识详解 一.Java虚拟机指令集 Java虚拟机指令由一个字节长度的.代表某种特定含义的操作码( ...

  9. python成长之路一

    1,计算机基础 CPU:中央处理器,相当于人类的大脑,运算中心,控制中心. 内存:暂时储存数据,与CPU交互,8G,16G,32G,64G § 优点:读取速度快. § 缺点:容量小,造价高,断电即消失 ...

  10. 洛谷P1048采药题解

    题目 这是一个裸的01背包,因为题目中没说可以采好多次,不多说上代码, #include<iostream> using namespace std; int main() { int n ...