80ers' Memory


Time Limit: 1 Second      Memory Limit: 32768 KB

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

Author: GAO, Fei
Source: The 6th Zhejiang Provincial Collegiate Programming Contest

#include <iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char str[][];
int n,k;
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
scanf("%s",&str[i]);
scanf("%d",&k);
for(int i=;i<=k;i++)
{
int x,ans=;
scanf("%d",&x);
for(;x>;x--)
{
char ch[];
scanf("%s",&ch);
for(int j=;j<=n;j++)
if (!strcmp(ch,str[j])) {ans++; break;}
}
printf("%d\n",ans);
}
return ;
}

ZOJ 3207 80ers' Memory(strcmp函数的用法)的更多相关文章

  1. 关于strcmp函数的用法

    strcmp函数是在string.h库下的han函数, 具体用法如下: strcmp函数是用来比较2个字符串的函数,如srcmp(字如果符串1,字符串2),从第一个字符开始比较,如果到最后两个字符串完 ...

  2. strcmp函数和memcmp函数的用法区别及联系

    前言: C语言中有很多东西容易搞混,最近笔者就遇到了一个问题.这里做个记录.就是memcmp和strcmp两者的用法,这里做个对比: 功能对比: A memcmp: 函数原型: int memcmp( ...

  3. ZOJ 80ers' Memory

    80ers' Memory Time Limit: 1 Second      Memory Limit: 32768 KB I guess most of us are so called 80er ...

  4. The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemF:80ers' Memory

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3207 题意:给出N个关键字符串,然后给出k行,每行Ni个字符串,找出每行有 ...

  5. qsort函数的用法

    qsort函数的用法   qsort 功 能: 使用快速排序例程进行排序  用 法: void qsort(void *base, int nelem, int width, int (*fcmp)( ...

  6. C语言 · 实现strcmp函数 · 字符串比较

    蓝桥杯练习场上碰到两个此类题了: 算法提高 11-1实现strcmp函数   时间限制:1.0s   内存限制:256.0MB      问题描述 自己实现一个比较字符串大小的函数,也即实现strcm ...

  7. tensorflow.nn.bidirectional_dynamic_rnn()函数的用法

    在分析Attention-over-attention源码过程中,对于tensorflow.nn.bidirectional_dynamic_rnn()函数的总结: 首先来看一下,函数: def bi ...

  8. C/C++ sort函数的用法

    sort函数的用法(#include<algorithm>) 做ACM题的时候,排序是一种经常要用到的操作.如果每次都自己写个冒泡之类的O(n^2)排序,不但程序容易超时,而且浪费宝贵的比 ...

  9. 有关日期的函数操作用法总结,to_date(),trunc(),add_months();

    相关知识链接: Oracle trunc()函数的用法 oracle add_months函数 Oracle日期格式转换,tochar(),todate() №2:取得当前日期是一个星期中的第几天,注 ...

随机推荐

  1. Tornado介绍与其Web应用结构

    1.介绍 tornado是一个Python web框架和异步网络库 起初由 FriendFeed 开发. 通过使用非阻塞网络I/O, Tornado 可以支持上万级的连接,处理 长连接, WebSoc ...

  2. C#驱动级模拟按键操作

    C#驱动级模拟按键操作 2013-09-26 03:17 ·AB叔 447 3 <- 点击左侧的数字“攒”一个吧 昨天遇到一个程序自动输入财付通密码的任务. 因为财付通密码控件是有安全保护的,所 ...

  3. js使用经验之谈

    1.  js 对象,先有的起作用.CSS属性,后有的起作用. 2. 方法中使用submit提交表单,如果提交后面还有代码需要执行,不能保证顺序.例如,提交后关闭页面,很可能会在提交前关闭页面,导致提交 ...

  4. RAID详解[RAID0/RAID1/RAID5]

    RAID(Redundant Array of Independent Disk 独立冗余磁盘阵列)技术是加州大学伯克利分校1987年提出,最初是为了组合小的廉价磁盘来代替大的昂贵磁盘,同时希望磁盘失 ...

  5. Linux mount/unmount命令(6/16)

    linux是一个优秀的开放源码的操作系统,可以运行在大到巨型小到掌上型各类计算机系统上,随着 linux系统的日渐成熟和稳定以及它开放源代码特有的优越性,linux在全世界得到了越来越广泛的应用.现在 ...

  6. 【leetcode刷题笔记】Convert Sorted Array to Binary Search Tree

    Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 题解 ...

  7. Spring 之定义切面尝试(基于 XML)

    有些场景下只能基于 XML 来定义切面. [Spring 之定义切面尝试] 1.XML 下定义切面(首先是要有一个对应的类...显然要比基于注解的麻烦) <?xml version=" ...

  8. jQuery UI 自定义样式的日历控件

    在线演示 本地下载

  9. HTML5侧滑聊天面板

    在线演示 本地下载

  10. Win32 API编程:显示系统进程列表

    #include <windows.h> #include <tlhelp32.h> // 声明快照函数的头文件 #include "tchar.h" #i ...