作业帮 > 英语 > 作业

英语翻译Air RaidTime Limit:1000MS Memory Limit:10000KTotal Submi

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/06/24 17:17:13
英语翻译
Air Raid
Time Limit:1000MS Memory Limit:10000K
Total Submissions:2515 Accepted:1502
Description
Consider a town where all the streets are one-way and each street leads from one intersection to another.It is also known that starting from an intersection and walking through town's streets you can never reach the same intersection i.e.the town's streets form no cycles.
With these assumptions your task is to write a program that finds the minimum number of paratroopers that can descend on the town and visit all the intersections of this town in such a way that more than one paratrooper visits no intersection.Each paratrooper lands at an intersection and can visit other intersections following the town streets.There are no restrictions about the starting intersection for each paratrooper.
Input
Your program should read sets of data.The first line of the input file contains the number of the data sets.Each data set specifies the structure of a town and has the format:
no_of_intersections
no_of_streets
S1 E1
S2 E2
.
Sno_of_streets Eno_of_streets
The first line of each data set contains a positive integer no_of_intersections (greater than 0 and less or equal to 120),which is the number of intersections in the town.The second line contains a positive integer no_of_streets,which is the number of streets in the town.The next no_of_streets lines,one for each street in the town,are randomly ordered and represent the town's streets.The line corresponding to street k (k
英语翻译Air RaidTime Limit:1000MS Memory Limit:10000KTotal Submi
空袭.
期限:1000MS内存限制:10000K
总递交:2515接受:273
描述,
考虑一个小镇的街道是单向的,每一个十字路口从街道到另一个地方.众所周知,从一个十字路口,走在城里的大街上你永远不能达到同样的路口如下.该镇街道形态没有周期.
你的任务是用这些假设编写一个程序,找到最少量的伞兵,可以在镇上所有的交叉点,参观这座城市以这样一种方式超过一名伞兵访问任何的十字路口.每一名伞兵降落在十字路口后,可以访问其他交叉口的小镇的街道.没有限制的每一位开始路口.
输入,
你的程序应该读数据集.第一行输入文件包含的数据集的数量.每个数据集指定的结构和格式的小镇
no_of_intersections
no_of_streets
S1 E1
中度E2
……
Sno_of_streets Eno_of_streets
第一行的每个数据集包含一个正整数no_of_intersections(大于0和小于或等于120),这是镇上的十字路口.第二行是一个正整数no_of_streets的数量,这是镇上街道.接下来no_of_streets线,每一个城里大街,是随机的命令和代表城镇的街道.对应于大街的< no_of_streets k(k)是由两个正整数,被一个空白:Sk(1)和(2)< = Sk < = no_of_intersections)——那就是交界处的开始的大街上,Ek(1)和(2)< Ek < = no_of_intersections)——交界处的就是这条街的尽头.交叉口为整数1 no_of_intersections.
没有空行连续之间的数据集.输入的数据是正确的.
输出
结果是在标准输出.对每个输入数据集程序打印在一行,开始从一开始的线条,一个整数:最少量的伞兵需要访问所有的交点在城内.
!这就是大致的了!