摘要: 令res[i][j]表示前i个邮局负责前j个村庄的最小值。res[i][j]=res[i-1][k] + dist(k+1,j), (i<=j<=m,i-1<=k<j);#include<iostream>#include<cstdio>#include<cstring>using namespace std;int pos[301],res[35][301];#define MAX 1234567890int min(int a,int b){ return a < b ? a : b;}int dist(int i,int 阅读全文
posted @ 2012-05-31 20:40 书山有路,学海无涯 阅读(370) 评论(0) 推荐(0) 编辑