(简单) 搜索 HOJ 1085 Finding Rectangles
来源:互联网 发布:网络购票岫岩到沈阳 编辑:程序博客网 时间:2024/06/05 04:57
Finding Rectangles
Submitted : 258, Accepted : 118
Your task is to write a program that can find all rectangles that can be formed from a given set of points. The example input and output given below correspond to the figures above.
Input
The input contains one or more point sets, followed by a line containing the number 0 that signals the end of the file. Each point set begins with a line containing n, the number of points, and is followed by n lines that describe the points. Each point description contains a capital letter that is the label of the point, then a space, the horizontal coordinate, a space, and the vertical coordinate. Within each set, points labels occur in alphabetical order.
Note that since each point is labelled with a capital letter there can be at most 26 points. All coordinates are nonnegative integers less than 50. Points within a set are unique.
Output
The output for each point set starts with ``Point set ", followed by the number of the point set and a colon. If there are no rectangles, `` No rectangles" appears after the colon. If there are rectangles, they are listed starting on the next line. A blank precedes each rectangle. Each rectangle is given by its vertex labels, in clockwise order from the upper left, so the order is upper left, upper right, lower right, lower left. The rectangles are listed ten per line, except for the last line, where there may be as few as one. The rectangles are listed in alphabetical order.
Sample Input
7A 1 1 B 2 1 C 3 1 D 2 3 E 3 3 F 1 4 G 3 4 8 B 1 1 D 2 1 F 4 1 J 4 4 L 2 4M 2 3N 4 3 P 1 2 12A 1 5B 2 5C 1 4D 2 4E 1 3F 2 3G 1 2H 2 2I 1 1J 2 1K 1 0L 2 05B 1 1D 2 1L 2 4N 2 3P 1 20
Sample Output
Point set 1: DECB FGCAPoint set 2: LJFD LJNM MNFDPoint set 3: ABDC ABFE ABHG ABJI ABLK CDFE CDHG CDJI CDLK EFHG EFJI EFLK GHJI GHLK IJLKPoint set 4: No rectangles
- (简单) 搜索 HOJ 1085 Finding Rectangles
- zoj 1179 Finding Rectangles
- POJ 1314 Finding Rectangles
- (简单) 搜索 HOJ 1066 Substrings
- (简单) 搜索 HOJ 1097 Robot
- POJ 1314 Finding Rectangles 笔记
- hdu 4414 Finding crosses 简单搜索
- hdu 4158 hoj 2581 Go 简单搜索
- poj1111 hoj 1639 Image Perimeters 简单搜索
- Go hdu 4158 hoj 简单搜索
- (简单)搜索 HOJ 1022 Spacecraft Malfunction
- (简单)搜索 HOJ 1030 Labyrinth
- (简单) 搜索 HOJ 1044 Transportation
- (简单) 搜索 HOJ 1048 Cipher
- (简单)搜索 HOJ 1070 Word
- (简单)搜索 HOJ 1075 The Castle
- (简单) 搜索 HOJ 1105 Egyptian Multiplication
- ZOJ 1179 Finding Rectangles(DFS+剪枝)
- textview 使用自己的字体
- (中等) 搜索 HOJ 1049 sticks
- (简单) 搜索 HOJ 1066 Substrings
- (简单)搜索 HOJ 1070 Word
- (简单)搜索 HOJ 1075 The Castle
- (简单) 搜索 HOJ 1085 Finding Rectangles
- (简单) 搜索 HOJ 1097 Robot
- (中等) 线段树 HDU 3308 LCIS
- (简单) 搜索 HOJ 1105 Egyptian Multiplication
- (简单) 搜索 最短路 HOJ 1121 Erdos Numbers
- (基础) 树形dp HDU 1520 Anniversary party
- (男人八题之一)树形dp poj 1741 Tree
- (男人八题)多重背包 POJ 1743 Coins
- ACM牛人给的新手建议
程序博客网,程序员的互联网技术博客家园。csdn论坛精品 msdn技术资料都在这里