ZOJ 3207: 80ers' Memory

ZOJ 3207:: 80ers‘ Memory

///@author Sycamore, ZJNU
///@date 2017-02-09
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int N;
	cin >> N;
	vector<string>v(N);
	for (auto &e : v)cin >> e;
	int K, n;
	cin >> K;
	while (K--)
	{
		int c = 0;
		cin >> n;
		string t;
		while (n--)
		{
			cin >> t;
			if (find(v.begin(), v.end(), t) != v.end())c++;
		}
		cout << c << endl;
	}
	return 0;
}

ZOJ 3207: 80ers' Memory

时间: 2024-12-31 02:10:18

ZOJ 3207: 80ers' Memory的相关文章

ZOJ 3207 80ers&#39; Memory (F)

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

浙江省第6届程序设计竞赛结题报告汇总 zoj3202-3212

zoj 3202 Second-price Auction 水题,不解释了,直接贴代码 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; struct node{ int x; int y; }; struct node number[105]; int cmp(struct node a,struct node b){

ACM/ICPC 之 BFS+状态压缩(POJ1324(ZOJ1361))

求一条蛇到(1,1)的最短路长,题目不简单,状态较多,需要考虑状态压缩,ZOJ的数据似乎比POj弱一些 POJ1324(ZOJ1361)-Holedox Moving 题意:一条已知初始状态的蛇,求其到(1,1)的最短路长 题解:开始做的时候用BFS暴力做了一次,结果RE了,后来看了其他的题解和discuss才转向状态压缩.也看到有人用A*做出来了. 现在简要介绍一下状态压缩的思路: 由于蛇身最长只有8,可以利用两条相邻蛇身坐标确定其相对方向(四个方向),两位二进制可以表示 这样 一个蛇头坐标+

概率dp ZOJ 3640

Help Me Escape Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3640 Appoint description:  System Crawler  (2014-10-22) Description Background     If thou doest well, shalt thou not be accepted? an

ZOJ 1718 POJ 2031 Building a Space Station 修建空间站 最小生成树 Kruskal算法

题目链接:ZOJ 1718 POJ 2031 Building a Space Station 修建空间站 Building a Space Station Time Limit: 2 Seconds      Memory Limit: 65536 KB You are a member of the space station engineering team, and are assigned a task in the construction process of the statio

ZOJ 3607 Lazier Salesgirl (贪心)

Lazier Salesgirl Time Limit: 2 Seconds      Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy

ZOJ - 2243 - Binary Search Heap Construction

先上题目: Binary Search Heap Construction Time Limit: 5 Seconds      Memory Limit: 32768 KB Read the statement of problem G for the definitions concerning trees. In the following we define the basic terminology of heaps. A heap is a tree whose internal n

ZOJ 3794 Greedy Driver

Greedy Driver Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on ZJU. Original ID: 3794 64-bit integer IO format: %lld      Java class name: Main Edward is a truck driver of a big company. His daily work is driving a truck from o

ZOJ 3199 Longest Repeated Substring

Longest Repeated Substring Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original ID: 319964-bit integer IO format: %lld      Java class name: Main Write a program that takes a string and returns length of the longest r