随笔分类 -  ACM_最短路

摘要:http://poj.org/problem?id=3259 1 #include 2 #include 3 #define maxn 5505 4 #define INF 9999999 5 typedef struct 6 { 7 int x,y,w; 8 }node; 9 node a... 阅读全文
posted @ 2014-04-18 19:48 清风旋叶 阅读(275) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1596 1 Problem : 1596 ( find the safest road ) Judge Status : Accepted 2 RunId : 10374805 Language : C++ Author : l1285556798 3 Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta 4 5 #include 6 #include 7 #define maxn 1001 8 d... 阅读全文
posted @ 2014-03-23 12:35 清风旋叶 阅读(151) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1599 1 Problem : 1599 ( find the mincost route ) Judge Status : Accepted 2 RunId : 10374468 Language : C++ Author : l1285556798 3 Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta 4 5 #include 6 #define INF 0xffffff 7 int map... 阅读全文
posted @ 2014-03-23 11:45 清风旋叶 阅读(140) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2112 1 #include 2 #include 3 #include 4 #define maxn 155 5 #define INF 0xffffff 6 using namespace std; 7 int map[maxn][maxn]; 8 char s1[10005][40],s2[10005][40],s[10005][40]; 9 int t[10005];10 int n,cnt=0;11 int solve(char *p)12 {13 for(int i=1;i<=cnt;i.. 阅读全文
posted @ 2014-03-19 13:53 清风旋叶 阅读(181) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1548 1 //hdu 1548 2 #include 3 #include 4 #define INF 999999 5 int map[202][202],vis[202],dist[202],pre[202]; 6 int n,a,b; 7 void dijkstra(int s) 8 { 9 for(int i=1;i0)51 map[i][i-k[i]]=1;52 }53 dijkstra(a);54 if(di... 阅读全文
posted @ 2014-03-16 16:03 清风旋叶 阅读(112) 评论(0) 推荐(0)