The main topic: according to the order of the clockwise or counter-clockwise to give a multilateral point, to break this polygon into a n-2 triangle, the requirements of these triangular rows of the largest area of the Triangle area as small as possible, to find the minimum value.
Ideas: with the interval DP can be easily solved, The polygon may be a concave shape, note that the triangle must be inside the polygon, so you can remove the split triangle contains other points, but other in the polygon outside the triangle did not think of other methods to remove, but AC, do not understand why
acceptedc++0.042#include<cstdio> #include <iostream> #include <algorithm> #include <cstring > #include <cmath>using namespace std; #define INF 0x3f3f3f3fconst double ESP = 1e-6;int n;struct point{Double X , Y;} POI[55];d ouble dp[55][55];d ouble Area (point A,point b,point c) {return fabs ((b.x-a.x) * (C.Y-A.Y)-(c.x-a.x) * ( B.Y-A.Y))/2.0;} BOOL Judge (int a,int b,int c) {for (int i = 1;i<=n;i++) {if (i==a| | i==b| | I==C) continue; Double S=area (poi[i],poi[a],poi[b]) +area (Poi[i],poi[b],poi[c]) +area (Poi[i],poi[c],poi[a]); if (Fabs (S-area (poi[a],poi[b],poi[c)) <esp) return true; } return false;} int main () {int T; scanf ("%d", &t); while (t--) {memset (dp,0,sizeof (DP)); scanf ("%d", &n); for (int i=1;i<=n;i++) {scanf ("%lf%lf", &poi[i].x,&poi[i].y); } for (int l=2;l<n;l++) for (int p=1;p+l<=n;p++) {dp[p][p+l]=inf; for (int k=p+1;k<p+l;k++) {if (judge (p,k,p+l)) continue; Dp[p][p+l]=min (Dp[p][p+l],max (Max (dp[p][k],dp[k][p+l]), area (Poi[p],poi[k],poi[p+l])); }} printf ("%.1f\n", Dp[1][n]); } return 0;}
Uva 1331-minimax Triangulation (optimal triangulation inter-partition DP)