摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2722分析:简单最短路,读入数据烦。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 450 9 #define inf 0xfffffff10 using namespace std;11 int blip[maxn];12 int n,m;13 bool vis[maxn];14 struct edge15 {16 int to,w;17 edg... 阅读全文
posted @ 2013-08-29 10:00 EtheGreat 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2363分析:最短路+二分。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define ll long long 10 #define maxn 105 11 #define inf 0x7fffffff 12 using namespace std; 13 int T,n,m,low,up; 14 int h[maxn],map[maxn][ma... 阅读全文
posted @ 2013-08-29 09:51 EtheGreat 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2962分析:最短路+二分。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #define ll long long11 #define inf 100000000012 #define maxn 100513 using namespace std;14 struct edge15 {16 int to,h,len;17 edg... 阅读全文
posted @ 2013-08-29 09:44 EtheGreat 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1217分析:floyd. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #define ll long long11 #define maxn 3312 #define inf 0xfffffff13 using namespace std;14 int n;char cur[30];15 mapm;16 double mapp[maxn][ma 阅读全文
posted @ 2013-08-29 09:32 EtheGreat 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1142分析:最短路+记忆化搜索。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define ll long long 9 #define inf 0x6fffffff10 #define maxn 100511 using namespace std;12 struct edge13 {14 int to,time;15 edge(int x,int y)16 ... 阅读全文
posted @ 2013-08-29 09:27 EtheGreat 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1874分析:SPFA|Dijkastra. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define ll long long 9 #define inf 0x6fffffff10 #define maxn 20511 using namespace std;12 int g[maxn][maxn],dis[maxn],n,m;13 bool vis[maxn];14 void dij 阅读全文
posted @ 2013-08-29 09:22 EtheGreat 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 原题连接:http://acm.hdu.edu.cn/showproblem.php?pid=2066分析:超级源点+SPFA。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define ll long long 9 #define inf 0xfffffff10 #define maxn 100511 using namespace std;12 struct edge13 {14 int to,time;15 edge (int x,int y)16 ... 阅读全文
posted @ 2013-08-29 09:15 EtheGreat 阅读(184) 评论(0) 推荐(0) 编辑