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

"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 (≤10​4​​), 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?

分析:水题

 /**
 * Copyright(c)
 * All rights reserved.
 * Author : Mered1th
 * Date : 2019-02-27-19.29.19
 * Description : A1116
 */
 #include<cstdio>
 #include<cstring>
 #include<iostream>
 #include<cmath>
 #include<algorithm>
 #include<string>
 #include<unordered_set>
 #include<map>
 #include<vector>
 #include<set>
 using namespace std;
 ;
 ;
 };
 bool isPrime(int x){
     ) return false;
     int sqr=(int)sqrt(1.0*x);
     ;i<=sqr;i++){
         )
             return false;
     }
     return true;
 }

 int main(){
 #ifdef ONLINE_JUDGE
 #else
     freopen("1.txt", "r", stdin);
 #endif
     int n,temp,k,q;
     scanf("%d",&n);
     ;i<=n;i++){
         scanf("%d",&temp);
         hashtable[temp]=i;
     }
     scanf("%d",&k);
     ;i<k;i++){
         scanf("%d",&q);
         ){
             printf("%04d: Mystery Award",q);
             hashtable[q]=INF;
         }
         else if(isPrime(hashtable[q])){
             printf("%04d: Minion",q);
             hashtable[q]=INF;
         }
         else if(hashtable[q]==INF){
             printf("%04d: Checked",q);
         }
         ){
             printf("%04d: Are you kidding?",q);
         }
         else{
             printf("%04d: Chocolate",q);
             hashtable[q]=INF;
         }
         printf("\n");
     }
     ;
 }
 

1116 Come on! Let's C (20 分)的更多相关文章

  1. 【PAT甲级】1116 Come on! Let's C (20分)

    题意: 输入一个正整数N(<=10000),接着依次输入N个学生的ID.输入一个正整数Q,接着询问Q次,每次输入一个学生的ID,如果这个学生的ID不出现在之前的排行榜上输出Are you kid ...

  2. pat 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 t ...

  3. 抛弃EF,20分构建一个属于自己的ORM框架

    Poiuyt_cyc 博客园首页新随笔联系订阅管理随笔 - 11  文章 - 0  评论 - 111 抛弃EF,20分构建一个属于自己的ORM框架 相信EF大家都不陌生了,因为数据库表跟程序实体是一一 ...

  4. PTA 邻接表存储图的广度优先遍历(20 分)

    6-2 邻接表存储图的广度优先遍历(20 分) 试实现邻接表存储图的广度优先遍历. 函数接口定义: void BFS ( LGraph Graph, Vertex S, void (*Visit)(V ...

  5. #020PAT 没整明白的题L1-009 N个数求和 (20 分)

    后面的测试点过不去,两个错误一个超时. 目前未解决   L1-009 N个数求和 (20 分)   本题的要求很简单,就是求N个数字的和.麻烦的是,这些数字是以有理数分子/分母的形式给出的,你输出的和 ...

  6. L1-023 输出GPLT (20 分)

    L1-023 输出GPLT (20 分) 给定一个长度不超过10000的.仅由英文字母构成的字符串.请将字符重新调整顺序,按GPLTGPLT....这样的顺序输出,并忽略其它字符.当然,四种字符(不区 ...

  7. PAT 乙级 1074 宇宙无敌加法器 (20 分)

    1074 宇宙无敌加法器 (20 分) 地球人习惯使用十进制数,并且默认一个数字的每一位都是十进制的.而在 PAT 星人开挂的世界里,每个数字的每一位都是不同进制的,这种神奇的数字称为“PAT数”.每 ...

  8. PAT 乙级 1044 火星数字 (20 分)

    1044 火星数字 (20 分) 火星人是以 13 进制计数的: 地球人的 0 被火星人称为 tret. 地球人数字 1 到 12 的火星文分别为:jan, feb, mar, apr, may, j ...

  9. PAT 甲级 1035 Password (20 分)

    1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for th ...

随机推荐

  1. 太完美 TWM000极度精简版XP20130123终结美化版

    TWM000极度精简版XP20130123终结美化版:蛋蛋20130123终结版为蓝本,虫子提供的美化包进行了美化.此版经测试完美在Z77主板开启AHCI安装,此为最终版之美化版!LiteXPMH.i ...

  2. 根据redis的pub/sub机制,写一个即时在线聊天应用

    在Redis中,有个Pub/Sub,他的主要的工作流程如: redis订阅一个模式频道如:chat_*,然后由小a想找人聊天了,就发送一个消息“现在有人聊天吗?chat_a”,末尾的chat_a为标识 ...

  3. WiFi Pineapple的Karma攻击与原理探究

    WiFi钓鱼是一种被炒烂了的安全威胁,你几乎每天都能从电视.网络媒体中看到因误连了恶意WiFi导致大笔资金失窃的案例,并且很多媒体语不惊人死不休的报道风格总是能把当事人的受害过程删减修饰到灵异的程度. ...

  4. 【Cocos2d-X(1.x 2.x) 修复篇】iOS6 中 libcurl.a 无法通过armv7s编译以及iOS6中无法正常游戏横屏的解决方法

    本站文章均为李华明Himi原创,转载务必在明显处注明:转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/iphone-cocos2dx/1000.html ...

  5. 解决Ubuntu下adb无法联接手机终端

    1.首先确认开发者选项中USB调试是否打开. 2.在终端输入lsusb,如下图: 查看设备是否已经连接,如果没有此选项,请检查你的手机数据线是否正常连接,否则你的手机就可以用来防身和砸核桃了. 3.在 ...

  6. IDC:2014年的十大 IT 趋势

    IDC:2014年的十大 IT 趋势 市场研究公司 IDC 近日发布报告,对 2014 年的十大科技行业发展趋势作出了预测.IDC 称,2014 年将是科技业"鏖战正酣"的一年,整 ...

  7. Android 源码阅读之SMS,MMS

    主界面: com.android.mms.ui.ConversationList.java  [extends ListActivity] 点击新建信息:onListItemClick -〉 posi ...

  8. 简单shell实现局域网IP扫描

    #!/bin/bash network=$1 time=$(date +%H%M%S) for i in $(seq $2 $3) do ping -c 1 -w 2 $network.$i > ...

  9. pycharm 提示性信息

    语法错误:文字底部红色波浪线 解决方案:语法修改正确 语法不符合规范:文字底部灰色波浪线 解决方案:快捷键(Alt + Enter + Enter ) 单词拼写提示:文字底部绿色波浪线 解决方案: 单 ...

  10. pandas.read_csv 参数 index_col=0

    index_col : int or sequence or False, default None 用作行索引的列编号或者列名,如果给定一个序列则有多个行索引. 如果文件不规则,行尾有分隔符,则可以 ...