| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 833 人关注过本帖
标题:求指教,麻烦各位看看这道竞赛题.
取消只看楼主 加入收藏
hana_flower
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-7-22
结帖率:0
收藏
 问题点数:0 回复次数:0 
求指教,麻烦各位看看这道竞赛题.
In this problem you will be given a number of scenarios. Each scenario begins with a line containing two digits X and Y (separated by a space) representing the length and width of the grid (0 < X, Y <= 30). A scenario in which X and Y are both 0 marks the end of input.

The second line of the scenario is a single digit M (0 < M <= 1000) which gives the number of items located by the archaeologists. This is followed by M lines each containing the X and Y coordinates of the grid cell in which an item was found. Note that the grid coordinate system starts at 0, 0 and that several items may be found in a particular cell, so cell coordinates may be repeated.

Following the M lines of item locations there is a list of cell references for which the total number of found items is required. The first line of this section is a single integer, N, which gives the number of cells (0 < N <= (X * Y)). There follows N lines each containing the X and Y coordinates of a cell.

Output consists of a single line for each scenario. It contains the total number of items found in the N cells listed.

For example:

Input Output
2 3     2
4       3
0 1
1 0
0 1
1 2
1
0 1
10 10
8
4 5
3 4
0 0
1 5
9 9
5 6
3 4
9 9
3
9 9
4 5
6 3
0 0

这是老师今天留给我们的题目,我英文水平有限,题和这道题的关系都有点看不明白,请教与网络,请大家帮帮忙。
搜索更多相关主题的帖子: scenario single problem number second 
2012-08-13 18:44
快速回复:求指教,麻烦各位看看这道竞赛题.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017305 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved