链接:https://ac.nowcoder.com/acm/contest/624/B
来源:牛客网

The university programming contest of HIT@WH is going to start!

As the main problem setter, Ramen is going to reply to the requests for clarification during the contest.

The level of the contestants is varied so that they will ask different questions. Some questions are foolish, the most stupid one among them is: Why I got WA on problem X?. Some are critical that may indicate that there is something went wrong, and juries need to investigate.

To make different responses for each request is unnecessary and boring, so Ramen has his own rules to answer the contestant. Here are the rules of how he makes a response:

- If the request is a statement, he will answer No Response.

- If the request is a stupid question, he will answer 42.

- If the question is not a stupid question and the question has been asked less or equal than five times, he will answer Read the problem statement carefully.

- If the question is not a stupid question and the question has been asked more than five times, he will answer Juries are investigating. Thanks.

A statement ends with a period(.) while a question ends with a question mark(?).

The contest is running, but Ramen has some urgent work to do, so he is absent. You know Ramen's rules, can you help him for a while?

输入描述:

The input contains multiple lines.The first line contains two integers n, q(1 <= n <= 10000, 1 <= q <= 100), indicates the number of requests and the number of stupid questions.Each of the next q lines contains a distinct stupid question.Then each of the next n lines contains a request for clarification.It's guaranteed that the all given strings will only contain Latin letters and spaces, and each line ends with a period or a question mark. The length of each of them will not exceed 100.

输出描述:

Output exactly n lines. The i-th line represents the answer to the i-th request of clarifications.

示例1

输入

复制

10 2
Why I got WA on problem A?
How to solve problem C?
The problems are really good.
Why I got WA on problem A?
Why I got CE?
Why I got CE?
How to solve problem C?
Why I got CE?
Why I got CE?
Why I got CE?
The constraint of E is correct?
Why I got CE?

输出

复制

No Response.
42.
Read the problem statement carefully.
Read the problem statement carefully.
42.
Read the problem statement carefully.
Read the problem statement carefully.
Read the problem statement carefully.
Read the problem statement carefully.
Juries are investigating. Thanks.

备注:

Do not forget to output the dot(.) at the end of each answer.What does 42 mean? It's the answer to life, the universe, and everything.You can still ask any question during the contest. It's guaranteed that juries will never answer you 42, seriously.

模拟:用map存一下gets获取一串的按题目模拟即可

#include<iostream>
#include<cstring>
#include<map>
using namespace std;
char a[10009];
string v[10009];
int main()
{int n,q;map<string,int>A;scanf("%d%d",&n,&q);getchar();for(int i = 0;i<q;++i){gets(a);int d = strlen(a);for(int j = 0;j < d;++j){v[i]+=a[j];}      }while(n--){gets(a);string s = "";int d = strlen(a);for(int i = 0;i < d;++i){s+=a[i];}  A[s]++;if(s[d-1] == '.'){printf("No Response.\n");continue;}int flag =0;for(int i = 0;i < q;++i){if(v[i] == s){flag =1;break;}}if(flag){printf("42.\n");continue;}else{if(A[s] <= 5){printf("Read the problem statement carefully.\n");}else{printf("Juries are investigating. Thanks.\n");}}}return 0;}

Clarifications相关推荐

  1. CW3 Clarifications

    代写CW3留学生作业.代做java/python程序设计作业.代做Clarifications作业.代写CS/python作业 CW3 Clarifications We have had many ...

  2. Book REPORT:Subject To Change

    Book REPORT:Subject To Change 曹竹 Sooner or later, every developer out there gets sick of the long ho ...

  3. 递推DP HDOJ 5459 Jesus Is Here

    题目传送门 题意:简单来说就是sn = sn-1 + sn-2递推而来,求其中所有c字符的:∑i<j:sn[i..i+2]=sn[j..j+2]=''cff"(j−i) mod 530 ...

  4. 在Spring Framework中@Inject和@Autowired有什么区别? 在什么条件下使用哪一个?

    本文翻译自:What is the difference between @Inject and @Autowired in Spring Framework? Which one to use un ...

  5. Redis 的性能幻想与残酷现实(转)

    2011 年,当初选择 Redis 作为主要的内存数据存储,主要吸引我的是它提供多样的基础数据结构可以很方便的实现业务需求.另一方面又比较担心它的性能是否足以支撑,毕竟当时 Redis 还属于比较新的 ...

  6. acm pc^2的配置与使用

    -------------------------------------------------------------------------------------- !!! 转载请注明: 转自 ...

  7. 在新加坡做面试官的经历 (Interviewer Experience for UI/UX Designer in Singapore)

    CONTENTS Brief 1st interview – Filipino (on-site interview) 2nd interview – Chinese (on-site intervi ...

  8. 神经网络,流形和拓扑Neural Networks, Manifolds, and Topology

    Recently, there's been a great deal of excitement and interest in deep neural networks because they' ...

  9. 哈尔滨工业大学(威海)第九届ACM程序设计竞赛

    Problem A All Palindrome https://ac.nowcoder.com/acm/contest/624/A 题解:这个字符串只能是所有字符相同的 /* *@Author: S ...

最新文章

  1. 面向对象之内置方法(简单)、组合。以及接口归一化设计与抽象类
  2. 编程之美2.13 子数组的最大乘积
  3. html符号纵向,HTML常用特殊符号对照表与一些标签说明.pdf
  4. php mysql数据库 指南_用 PHP 创建 MySQL 数据库
  5. 用PHP做负载均衡指南
  6. ie6 css padding,IE6padding的一个影响布局的问题在
  7. 英业达软件测试工程师,「天津英业达软件测试工程师」面试招聘|工资待遇 - 看准网...
  8. 自从知道了这几个 JavaScript 技巧,下班都变早了!
  9. 【待完善】【表达学习】稀疏表达SRC方法研究
  10. js 数组、对象转json 以及json转 数组、对象
  11. Hive的下载和安装
  12. vue 图片放大查看器
  13. 电视盒子刷鸿蒙系统,家里的智能电视能装鸿蒙系统吗?鸿蒙系统有哪些优势?...
  14. c++ 小游戏 NO 4 eye
  15. Android MediaPlayer整体架构源码分析 -【MediaCodec编解码器插件模块化注册和创建处理流程】【Part 6】
  16. ATM(异步传输模式)
  17. 魔众微信管理系统 v1.0.0 更简单可用的微信公众号管理系统
  18. Resilience4j简介
  19. 电路板上的黑色小圆“疙瘩”到底是什么?有什么用?
  20. android 卡顿、ANR优化(1)屏幕刷新机制

热门文章

  1. Python中text文件操作
  2. Python例题(一) 输入一个正整数判断是不是素数
  3. Elasticsearch系列-安装部署
  4. 赫容俏的益生元综合果蔬饮究竟是什么?
  5. 我用索引下推把MySQL性能一下优化了100倍,你信吗?
  6. 第二节 概率、古典概型、几何概型
  7. 将毫秒换算成天、时、分、秒
  8. 十进制转二进制,八进制,十六进制(PHP)
  9. python里config_Python config.get_config方法代码示例
  10. 海马T1团餐机副屏显示系统设置中,请前往前屏操作