| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 712 人关注过本帖
标题:ACM中的2个问题!求教!
只看楼主 加入收藏
xiaoz214
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2009-8-28
结帖率:0
收藏
已结贴  问题点数:20 回复次数:3 
ACM中的2个问题!求教!
1.北极网络
  国防的(免打扰)部门要连接到无线网络北部几个据点。两种不同的通信技术,将在建立网络的使用:每一个哨所将有一个无线电收发器和一些前哨将另外有一个卫星频道。
  一个卫星频道的任何两个据点可以通过卫星进行通信,不论其地理位置。否则,这两个据点可以通过无线电通讯只有当它们之间的距离不超过D的对收发器的功率而定。高功率D,而收益率较高的成本更多。由于采购和维修的考虑,在前哨的收发器必须是相同的,即对D值是对每一个前哨相同。
  你的任务是确定最低的收发器D的要求。必须有至少一个通信路径(直接或间接)之间对每一个前哨。

输入格式:(a4.in)
  在输入的第一行包含N,则测试的个案。每个测试案例的第一行包含1≤S≤100个,卫星频道数量,和S<P≤500,数量的前哨。 P线跟随,给予的(x,y)的每公里哨所坐标(坐标为0到10,000之间的整数)。

输出格式:(a4.out)
  对于每个情况下,输出应该由一个单一给予最低D的要求连接的网络线路。输出应指定2小数点。

示例输入:
 1
 2 4
 0 100
 0 300
 0 600
 150 750

示例输出:
 212.13




2护卫的农场
  农场有许多丘陵农民赖以约翰希望雇佣警卫,确保了宝贵的牛奶安全奶牛。
  他说,有多少警卫,他需要,如果他希望把每一个山顶之一。他作为一个整数矩阵提供了一份地图;矩阵有N(1“?≤700)行和M(1”M“700)列。矩阵的每个成员是一个高度H_ij(0≤H_ij≤10000)。帮助他在地图上确定的山头数量。
  阿山顶是一个或多个包围一方的地图或较低(较小)的高度要素的优势完全同等价值的邻接矩阵的元素。两种不同的元素,如果相邻的不同规模的X坐标是不大于1,在他们的Y坐标的差异程度也没有大于1。

输入格式:(a5.in)
 *第1行:两个空间分隔的整数:N和M *线路2 .. N +1个:I线1描述了与M空间分隔的整数:H_ij矩阵i行。

输出格式:(a5.out)
 *第1行:一个整数,指定山顶数

示例输入:
 8 7
 4 3 2 2 1 0 1
 3 3 3 2 1 0 1
 2 2 2 2 1 0 0
 2 1 1 1 1 0 0
 1 1 0 0 0 1 0
 0 0 0 1 1 1 0
 0 1 2 2 1 1 0
 0 1 1 1 2 1 0

示例输出:3
搜索更多相关主题的帖子: ACM 
2009-09-02 12:32
ool
Rank: 2
等 级:论坛游民
帖 子:15
专家分:23
注 册:2009-8-5
收藏
得分:20 
翻译的,不明白的,我,蹩脚的,难懂的
2009-09-02 16:40
xiaoz214
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2009-8-28
收藏
得分:0 
1
 Arctic Network(TOJ1411)——(a4.cpp)
  The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceiver and some outposts will in addition have a satellite channel.
  Any two outposts with a satellite channel can communicate via the satellite, regardless of their location. Otherwise, two outposts can communicate by radio only if the distance between them does not exceed D, which depends of the power of the transceivers. Higher power yields higher D but costs more. Due to purchasing and maintenance considerations, the transceivers at the outposts must be identical; that is, the value of D is the same for every pair of outposts.
  Your job is to determine the minimum D required for the transceivers. There must be at least one communication path (direct or indirect) between every pair of outposts.

Input Format: (a4.in)
  The first line of input contains N, the number of test cases. The first line of each test case contains 1 ≤ S ≤ 100, the number of satellite channels, and S < P ≤ 500, the number of outposts. P lines follow, giving the (x,y) coordinates of each outpost in km (coordinates are integers between 0 and 10,000).

Output Format: (a4.out)
  For each case, output should consist of a single line giving the minimum D required to connect the network. Output should be specified to 2 decimal points.

Sample Input:
1
2 4
0 100
0 300
0 600
150 750

Sample Output:
212.13

2
: Guarding the Farm(TOJ3144)——(a5.cpp)
  The farm has many hills upon which Farmer John would like to place guards to ensure the safety of his valuable milk-cows.
  He wonders how many guards he will need if he wishes to put one on top of each hill. He has a map supplied as a matrix of integers; the matrix has N (1 < N ≤ 700) rows and M (1 < M < 700) columns. Each member of the matrix is an altitude H_ij (0 ≤ H_ij ≤ 10,000). Help him determine the number of hilltops on the map.
  A hilltop is one or more adjacent matrix elements of the same value surrounded exclusively by either the edge of the map or elements with a lower (smaller) altitude. Two different elements are adjacent if the magnitude of difference in their X coordinates is no greater than 1 and the magnitude of differences in their Y coordinates is also no greater than 1.

Input Format: (a5.in)
* Line 1: Two space-separated integers: N and M* Lines 2..N+1: Line i+1 describes row i of the matrix with M space-separated integers: H_ij.

Output Format: (a5.out)
* Line 1: A single integer that specifies the number of hilltops

Sample Input:
8 7
4 3 2 2 1 0 1
3 3 3 2 1 0 1
2 2 2 2 1 0 0
2 1 1 1 1 0 0
1 1 0 0 0 1 0
0 0 0 1 1 1 0
0 1 2 2 1 1 0
0 1 1 1 2 1 0

Sample Output:3
2009-09-02 17:40
xiaoz214
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2009-8-28
收藏
得分:0 
4.  该署的国家防卫 (DND) 希望通过无线网络连接几个北部据点。 要使用在建立网络的两种不同的通信技术: 每一个关卡会有一个无线电收发器,一些据点此外必须卫星信道。   任何两个据点卫星通道可以进行通信通过卫星无论它们的位置。 否则,两个据点可以通信通过无线电只,而他们之间的距离不超过,取决于该收发器的权力的 D。 高功率产生但成本较高 D 更多。 采购和维修的考虑,在该据点的收发器必须是完全相同 ; D 的值是据点的每对相同的就是。   您的工作是确定需要收发器的最低 D。 必须有至少一个通信路径 (直接或间接) 的据点的每个对之间。
Input Format: (a4.in)
输入的第一行包含 N,测试个案数目。 每个测试用例第一行包含 1 ≤ S ≤ 100,卫星的渠道和 S P ≤ 500,据点的数目的数目。 P 行按照给予 (x,y) 的每个在公里的关卡的坐标 (坐标是 0 和 10,000 之间的整数)。
Output Format: (a4.out)
每宗个案,输出应由一行给予连接网络所需的最低 D 组成。 输出应指定 2 十进制点。
Sample Input:
1
2 4
0 100
0 300
0 600
150 750

Sample Output:
212.13
5.  该农场有很多山,农民约翰想放置以确保安全的他的宝贵奶牛守卫。   他怀疑如果他想把每个山的基础上,他将需要多少守卫。 他的整数矩阵作为提供的地图,矩阵已 N (1 N ≤ 700) 行和 M (1M 700) 列。 矩阵的每个成员是一个高度 H_ij (0 ≤ H_ij ≤ 10,000)。 帮助他确定在地图上的山头的数目。   一个山顶是值的相同以独占方式被映射的边缘或具有较低的 (小) 高度元素包围的一个或多个相邻矩阵元素。 如果他们的 X 坐标差异的严重程度不大于 1,他们的 Y 坐标中的差异的严重程度也不大于 1,则相邻使用两个不同的元素。
Input Format: (a5.in)
1 线: 两个分隔空间整数: N 和 M
2 线 N+1线我介绍我与 M 矩阵的空间分隔的行整数: H_ij。
Output Format: (a5.out)
第 1 行: 为单个整数,指定的山头数
Sample Input:
8 7
4 3 2 2 1 0 1
3 3 3 2 1 0 1
2 2 2 2 1 0 0
2 1 1 1 1 0 0
1 1 0 0 0 1 0
0 0 0 1 1 1 0
0 1 2 2 1 1 0
0 1 1 1 2 1 0

Sample Output:
3

好点的翻译!
2009-09-02 22:37
快速回复:ACM中的2个问题!求教!
数据加载中...
 
   



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

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