摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4360 1 #include <iostream> 2 #include <vector> 3 #include <queue> 4 #include <cstdio> 5 using namespace std; 6 const long long inf = 1ll<<57; 7 const int Ni = 1320*2; 8 struct node{ 9 int v,w,e;10 node(){}11 node(int a,int b,int 阅读全文
posted @ 2012-08-15 20:18 qijinbiao1 阅读(434) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4362dp[i][j]=min{dp[i-1][k]+abs(arr[i][j].x-arr[i-1][k].x)+arr[i][j].w}1、优先队列法: 1 #include <iostream> 2 #include <cstring> 3 #include <queue> 4 #include <algorithm> 5 #include <cstdio> 6 using namespace std; 7 const int Ni = 100 阅读全文
posted @ 2012-08-15 15:40 qijinbiao1 阅读(378) 评论(0) 推荐(0) 编辑