博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1116 Come on! Let's C (20 分)
阅读量:4982 次
发布时间:2019-06-12

本文共 2319 字,大约阅读时间需要 7 分钟。

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 (104​​), 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:

61111666688881234555500016888800011111222288882222

Sample Output:

8888: Minion0001: Chocolate1111: Mystery Award2222: Are you kidding?8888: Checked2222: Are you kidding? 分析:水题
1 /** 2 * Copyright(c) 3 * All rights reserved. 4 * Author : Mered1th 5 * Date : 2019-02-27-19.29.19 6 * Description : A1116 7 */ 8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 using namespace std;19 const int maxn=100010;20 const int INF=1000000000;21 int hashtable[maxn]={ 0};22 bool isPrime(int x){23 if(x<=1) return false;24 int sqr=(int)sqrt(1.0*x);25 for(int i=2;i<=sqr;i++){26 if(x%i==0)27 return false;28 }29 return true;30 }31 32 33 int main(){34 #ifdef ONLINE_JUDGE35 #else36 freopen("1.txt", "r", stdin);37 #endif38 int n,temp,k,q;39 scanf("%d",&n);40 for(int i=1;i<=n;i++){41 scanf("%d",&temp);42 hashtable[temp]=i;43 }44 scanf("%d",&k);45 for(int i=0;i

 

 

转载于:https://www.cnblogs.com/Mered1th/p/10447127.html

你可能感兴趣的文章
【转载】servlet与springMVC的差别
查看>>
【转载】为什么用自增列作为主键
查看>>
【转载】ArrayList从源码看扩容实现
查看>>
【转载】
查看>>
【转载】门面日志如何自动发现日志组件
查看>>
【转载】web.xml
查看>>
【转载】MDC 是什么?
查看>>
【原创】Ajax实现方式
查看>>
【转载】spring aop 面试考点
查看>>
【转载】在分布式项目中,每个服务器的日志从产生,到集中到一个统一日志平台的流程是什么,中间都有那些过程?...
查看>>
Spring AOP知识点整理
查看>>
文本相关杂七杂八
查看>>
Mac安装scala插件
查看>>
scala元组及拉链操作
查看>>
scala数组
查看>>
scala的基础数据类型&if条件表达式&for循环
查看>>
scala集合三大类(seq序列,set集,map映射)——list序列
查看>>
scala方法和涵数的声明以及方法转换成涵数
查看>>
scala集合三大类(seq序列,set集,map映射)——map映射
查看>>
scala的map映射
查看>>