"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 (≤), 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 <iostream>
#include <cmath>
using namespace std;
int rankList[] = {};//存储排名
bool check[] = { false };//是否已经查询过
int n, k, id;
bool isPrime(int x)
{
if (x <= )
return x > ;
for (int i = ; i*i <= x; ++i)
if (x%i == )
return false;
return true;
}
int main()
{
cin >> n;
for (int i = ; i <= n; ++i)
{
cin >> id;
rankList[id] = i;
}
cin >> k;
while (k--)
{
cin >> id;
if (rankList[id] == )
printf("%04d: Are you kidding?\n", id);
else if (check[id] == true)
printf("%04d: Checked\n", id);
else if (rankList[id] == )
printf("%04d: Mystery Award\n", id);
else if (isPrime(rankList[id]))
printf("%04d: Minion\n", id);
else
printf("%04d: Chocolate\n", id);
check[id] = true;
}
return ;
}

最新文章

  1. mongoDB index introduction
  2. Android -- View移动的六种方法
  3. objective-c第六章课后练习5
  4. Android ListView简单实用
  5. android 破解工具
  6. [转]在VS2010 VC++项目中引用Lib静态库(以Openssl为例)
  7. Java NIO框架Mina、Netty、Grizzly介绍与对比
  8. JS无缝文字滚动(兼容各大浏览器)
  9. React-Native学习指南
  10. ANDROID_MARS学习笔记_S01原始版_014_WIFI
  11. Optimal Milking
  12. 【转】各个层次的gcc警告 #pragma GCC diagnostic ignored &quot;-Wunused-parameter&quot; --不错
  13. .NET框架设计—常被忽视的C#设计技巧
  14. 201521123096《Java程序设计》第十周学习总结
  15. kafka和strom集群的环境安装
  16. 启动jar的方式
  17. 跨域 jQuery库ajax请求
  18. BZOJ4381 : [POI2015]Odwiedziny / Luogu3591[POI2015]ODW - 分块+树剖
  19. Spring之Bean的注入
  20. 惊闻企业Web应用生成平台 活字格 V4.0 免费了,不单可视化设计器免费,服务器也免费!

热门文章

  1. springBoot项目mybatis中加入缓存
  2. Dao层结合Service层处理异常
  3. 七牛云-C#SDK-上传-前期准备
  4. 线性dp——hdu6578经典dp
  5. js判断是否为手机端访问
  6. lua执行的两种方式
  7. NX二次开发-将工程图视图+尺寸的最大边界导出图片
  8. NX二次开发-将对象移动到图层UF_OBJ_set_layer
  9. C++ 将汉字转换成拼音全拼【转载】
  10. CentOS yum 安装 g++ 4.7.2 &amp; c++11