Triangle
| Time Limit: 3000MS | Memory Limit: 30000K | |
| Total Submissions: 4224 | Accepted: 1149 |
Description
Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points.
Input
The input consists of several test cases. The first line of each test case contains an integer n, indicating the number of points on the plane. Each of the following n lines contains two integer xi and yi, indicating the ith points. The last line of the input is an integer −1, indicating the end of input, which should not be processed. You may assume that 1 <= n <= 50000 and −10
4 <= xi, yi <= 10
4 for all i = 1 . . . n.
Output
For each test case, print a line containing the maximum area, which contains two digits after the decimal point. You may assume that there is always an answer which is greater than zero.
Sample Input
3 3 4 2 6 2 7 5 2 6 3 9 2 0 8 0 6 5 -1
Sample Output
0.50 27.00
Source

介绍了一种通过计算凸包并运用旋转卡壳算法找到平面上给定点中最大面积三角形的方法。该算法首先确定凸包上的点,然后利用旋转卡壳技术找出具有最大面积的三角形。
1521

被折叠的 条评论
为什么被折叠?



