摘要:
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 阅读全文
摘要:
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... 阅读全文