ZOJ#3207:80ers' Memory
来源:互联网 发布:淘宝利润率计算公式 编辑:程序博客网 时间:2024/06/06 02:34
Memory Limit: 32768KB
64bit IO Format: %lld & %llu
Description
I guess most of us are so called 80ers, which means that we were born in the 1980’s. This group of people shared a lot of common memories. For example, the Saint Seiya, the YoYo ball, the Super Mario, and so on. Do you still remember these?
Input
There will be ONLY ONE test case.
The test case begins with a positive integer N, (N < 100).
Then there will be N lines each containing a single word describing a keyword of the typical 80ers’ memories. Each word consists of letters, [a-zA-Z], numbers, [0-9], and the underline, ‘_’. The length of each word would be no more than 20.
Then one line follows with a positive integer K, (K < 100).
The last part of the test case will be K lines. The i-th line contains the keywords given by the i-th person and starts with a positive integer Ni. Then there will be Ni words separated by white spaces. Each of these words has no more than 20 characters.
All the words are case sensitive.
Output
For each of these K people, you are asked to count the number of typical 80ers’ keywords on his/her list and output it in a single line.
Sample Input
4
Saint_Seiya
YoYo_ball
Super_Mario
HuLuWa
3
2 Saint_Seiya TiaoFangZi
1 KTV
3 HuLuWa YOYO_BALL YoYo_ball
Sample Output
1
0
2
Source
The 6th Zhejiang Provincial Collegiate Programming Contest
AC代码如下:
#include<iostream>#include<string>#include<cstring>using namespace std;int main(){ string a[101],t; int N,k; cin>>N; for(int i=0;i<N;i++) cin>>a[i]; cin>>k; for(int i=0;i<k;i++) { int w=0,f; cin>>f; while(f--) { cin>>t; for(int i=0;i<N;i++) { if(t==a[i]) w++; else continue; } } cout<<w<<endl; } return 0;}
- ZOJ#3207:80ers' Memory
- ZOJ 80ers' Memory
- zoj 3207 80ers' Memory(水~)
- zoj 3211 80ers' Memory
- ZOJ-3207-80ers' Memory【6th浙江省赛】【STL】
- ZOJ 320780ers' Memory(STL)
- 80ers' Memory
- 80ers' Memory
- ZOJ3207 80ers' Memory
- ZOJ3207-80ers' Memory
- F. 80ers' Memory
- 省赛热身赛之80ers' Memory
- 2014ACM集训13级PK赛4-80ers' Memory
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemF:80ers' Memory
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemF:80ers' Memory
- zoj 1414 //Memory Limit Exceeded
- ERS Precise Orbit Determination: Orbits
- 读取ERS 格式说明网址
- 怎么样把pdf压缩到最小
- C# Left, Right and Mid函数
- 自定义注解Annotation
- isAssignableFrom 和 instanceof
- okhttp 文件上传下载
- ZOJ#3207:80ers' Memory
- RxJava RxAndroid理论知识详解
- MySQL忘记root密码怎么办?
- iterator 的小东西
- 终端改字体颜色,非终端背景色
- ZEDBOARD 视频扩展板子上实现HDMI,代码
- springMVC教程-快速入手-深入分析
- 科目二考试注意事项笔记
- Head First Design Patterns 阅读笔记之八: the Template Method Pattern