日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Clarifications

發布時間:2024/1/18 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Clarifications 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?鏈接: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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。