2013年8月2日

区间DP Zoj 3537 Cake 区间DP 最优三角形剖分

摘要: 下面是别人的解题报告的链接,讲解很详细,要注意细节的处理。。。以及为什么可以这样做http://blog.csdn.net/woshi250hua/article/details/7824433我的代码: 1 //其中求凸包用的是Andrew扫描算法,复杂度主要为排序O(n*logn),扫描为O(n) 2 #include 3 #include 4 #define INF 100000000 5 #define min(a,b) a=3。0,1,2特判,如果有需要的话26 int andrew(point p[],int n)27 {28 sort(p,p+n);29 in... 阅读全文

posted @ 2013-08-02 21:04 allh123 阅读(206) 评论(0) 推荐(0) 编辑

HDU 2108 逆时针给出多边形的顶点,判断是否为凸多边形,水题

摘要: 下面是别人解题报告的链接,很详细,写的很好http://blog.csdn.net/chl_3205/article/details/8520597下面贴我的代码 1 #include 2 struct point 3 { 4 int x,y; 5 } p[100005]; 6 bool checkDir(point p0,point p1,point p2) 7 { 8 if((p1.x-p0.x)*(p2.y-p0.y)-(p1.y-p0.y) * (p2.x-p0.x) > 0) 9 return true;10 else return fals... 阅读全文

posted @ 2013-08-02 19:04 allh123 阅读(353) 评论(0) 推荐(0) 编辑

POJ 3311 Hie with the Pie 先用floyd预处理,再状态压缩

摘要: 下面是别人的解题报告链接:http://blog.csdn.net/accry/article/details/6607703下面是我的代码,我觉得链接中的代码有一点小问题,也许是我想错了吧。 1 #include 2 #define min(a,b) (a) < (b) ? (a) : (b); 3 #define INF 100000000 4 int dist[13][13]; 5 int dp[2050][13]; 6 void init(int n) 7 { 8 for(int i=0; i<=n; ++i) 9 for(int j=0; j<=n; ++j... 阅读全文

posted @ 2013-08-02 15:06 allh123 阅读(192) 评论(0) 推荐(0) 编辑

导航