摘要: Unidirectional TSPBackgroundProblems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI routing problems is minimizing wire length. The Traveling Salesperson Problem (TSP) -- finding whether all the cities in 阅读全文
posted @ 2013-05-04 21:31 剑不飞 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 10003 - Cutting SticksTime limit: 3.000 seconds思路:水啊,dp[a][b]a到b之间全切完的最小值。 dp[a][b]=min(dp[a][k]+dp[k][b])+ab段长度。k为ab段中的切点。#include #include #include using namespace std; const int mm=55; const int oo=1e9; int f[mm]; int dp[mm][mm];///a到b之间的最优值 int ans; int DP(int a,int b) { if(dp[a][b])return... 阅读全文
posted @ 2013-05-04 19:54 剑不飞 阅读(139) 评论(0) 推荐(0) 编辑