PKU 3093 Margaritas on the River Walk
        先对输入的数组排序,然后类似于01对a[i]做决策,核心代码加了注释:
         for (i=1; i<=n; i++) {
                 for (j=1; j<=maxsum; j++) {
                        if (j >= sum[i]) d[i][j] = 1; //j比sum[i]大,肯定这时候d[i][j]=1;
                        else {
                                d[i][j] = d[i-1][j];//不考虑a[i]
                                if (j-a[i]>=0) {//考虑a[i]
                                         if (d[i-1][j-a[i]] > 0) d[i][j] += d[i-1][j-a[i]];//把a[i]加进以前的选择里面
                                         else d[i][j]++;//a[i]单独作为一个选择(这里需要先对a[i]排序,消除后效性)
                               }
                        }
                 }
         }

PKU 1037 A decorative fence
        先dp算出以i为起点的序列的个数,再组合数学
        td[n][i]和tu[n][i]分别表示个数为n,以i开始的上升和下降的序列个数
        易知:
        td[n][1] = 0;
        td[n][i] = sigma(tu[n-1][j], j从1..i-1)  = td[n][i-1] + tu[n-1][i-1] ;
        tu[n][i]  = td[n][n+i-1];

PKU 2677 Tour
        双调欧几里德旅行商问题(明显阶段dp)
        动态规划方程 :d[i+1][i] = mint(d[i+1][i], d[i][j]+g[j][i+1]); 
                                      d[i+1][j] = mint(d[i+1][j], d[i][j]+g[i][i+1]);
                                       0<=j<i   

PKU 2288 Islands and Bridges
        集合DP
        状态表示: d[i][j][k] (i为13为二进制表示点的状态, j为当前节点, k为到达j的前驱节点)