2013年5月28日

白书上的Bellman-Ford模板

摘要: #include #include #include #include #include #include #include #include #include #include using namespace std; const int maxn=11111; struct Edge{ int from,to; int dist; }; struct BellmanFord{ int n,m; vector edges; vector G[maxn]; bool inq[maxn]; int d[maxn]... 阅读全文

posted @ 2013-05-28 08:20 电子幼体 阅读(163) 评论(0) 推荐(0) 编辑

Uva 11090 - Going in Cycle!! bellman-ford 负权环 二分

摘要: IIUPC2006Problem G: Going in Cycle!!Input: standard inputOutput: standard outputYou are given a weighted directed graph withnvertices andmedges. Each cycle in the graph has a weight, which equals to sum of its edges. There are so many cycles in the graph with different weights. In this problem we wa 阅读全文

posted @ 2013-05-28 08:19 电子幼体 阅读(330) 评论(0) 推荐(0) 编辑

Uva 10917 - Walk Through the Forest 最短路

摘要: Problem C: A Walk Through the ForestJimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even nicer, his office is on one side of a forest, and his house is on the other. A nice wa 阅读全文

posted @ 2013-05-28 02:05 电子幼体 阅读(153) 评论(0) 推荐(0) 编辑

导航