匈牙利算法 hdu 1151有向图的最小路径覆盖=顶点数-最大

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_intersectionsno_of_streetsS1 E1S2 E2……Sno_of_streets Eno_of_streetsThe 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 <= no_of_streets) consists of two positive integers, separated by one blank: Sk (1 <= Sk <= no_of_intersections) – the number of the intersection that is the start of the street, and Ek (1 <= Ek <= no_of_intersections) – the number of the intersection that is the end of the street. Intersections are represented by integers from 1 to no_of_intersections.There are no blank lines between consecutive sets of data. Input data are correct.

,因为冲动会做下让自己无法挽回的事情。

匈牙利算法 hdu 1151有向图的最小路径覆盖=顶点数-最大

相关文章:

你感兴趣的文章:

标签云: