
DAG
synapse7
这个作者很懒,什么都没留下…
展开
-
UVa 103 Stacking Boxes (DP&DAG)
103 - Stacking BoxesTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=39BackgroundSome concepts in Math原创 2013-09-17 20:40:41 · 1114 阅读 · 0 评论 -
UVa 200 Rare Order (拓扑排序)
200 - Rare OrderTime limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=136题意:给一列单词,这些单词是按一种未知的字典顺序排列的,要求输出这些字母原创 2013-11-18 12:28:07 · 2036 阅读 · 0 评论 -
UVa 437 The Tower of Babylon (DP&DAG)
437 - The Tower of BabylonTime limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=378思路:对于一个(x,y,z)砖头,它可以有3中姿势原创 2013-11-21 13:05:15 · 1302 阅读 · 3 评论 -
UVa 10000 Longest Paths (单源最长路 - floyd or 拓扑排序)
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=941由于n很小,floyd算法写起来方便,先用这个A了一下:/*0.162s*/#includeusing namespace std;const int mx = 105;i原创 2014-02-16 14:22:23 · 2073 阅读 · 0 评论 -
最短路模板(二)——用拓扑排序解决有向无环图中的最短路
测试数据:8 135 4 0.354 7 0.375 7 0.285 1 0.324 0 0.380 2 0.263 7 0.391 3 0.297 2 0.346 2 0.403 6 0.526 0 0.586 4 0.93测试结果:5 to 0 : 0.735 to 1 : 0.325 to 2 : 0.625 t原创 2014-02-16 13:50:11 · 2421 阅读 · 0 评论