dp
1 #include2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct node { 8 int x,y,h; 9 void init (int nx,int ny,int nh){10 x=nx;y=ny;h=nh;11 }12 }d[100];13 14 int dp[100];15 int g[100][100];16 17 bool cmp (node x,node y){18 if (x.x >n&&n){35 for (int i=0;i >x[0]>>x[1]>>x[2];38 sort (x,x+3);39 d[i*3].init (x[0],x[1],x[2]);40 d[i*3+1].init (x[0],x[2],x[1]);41 d[i*3+2].init (x[1],x[2],x[0]);42 }43 n*=3;44 sort (d,d+n,cmp);45 memset (g,0,sizeof g);46 for (int i=0;i