最短路/差分约束
文章平均质量分 77
大白QQly成长日记
小白自远方来
展开
-
信道安全 (SPFA)
描述 Alpha 机构有自己的一套网络系统进行信息传送。情报员 A 位于节点 1,他准备将一份情报发送给位于节点 n 的情报部门。可是由于最近国际纷争,战事不断,很多信道都有可能被遭到监视或破坏。经过测试分析,Alpha 情报系统获得了网络中每段信道安全可靠性的概率,情报员 A 决定选择一条安全性最高,即概率最大的信道路径进行发送情报。你能帮情报员 A 找到这条信道路径吗? 输入第一行...原创 2018-05-24 15:36:05 · 1008 阅读 · 0 评论 -
布线问题(Prim)
描述 南阳理工学院要进行用电线路改造,现在校长要求设计师设计出一种布线方式,该布线方式需要满足以下条件:1、把所有的楼都供上电。2、所用电线花费最少 输入第一行是一个整数n表示有n组测试数据。(n<5)每组测试数据的第一行是两个整数v,e.v表示学校里楼的总个数(v<=500)随后的e行里,每行有三个整数a,b,c表示a与b之间如果建铺设线路花费为c(...原创 2018-05-29 14:03:55 · 378 阅读 · 0 评论 -
POJ 1511-Invitation Cards(SPFA)
DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Co...原创 2018-09-19 20:35:01 · 234 阅读 · 0 评论 -
POJ 3159-Candies(差分约束)
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the...原创 2018-09-23 15:25:00 · 190 阅读 · 0 评论 -
差分约束系统
差分约束系统百度百科:如果一个系统由n个变量和m个约束条件组成,形成m个形如ai-aj≤k的不等式(i,j∈[1,n],k为常数),则称其为差分约束系统(system of difference constraints)。亦即,差分约束系统是求解关于一组变量的特殊不等式组的方法。看完这个定义,可能不知道这东西能干嘛,最近在练习最短路,联想一下floyd,dij,spfa,会发现抽象出来的数学模...转载 2018-09-19 17:30:14 · 226 阅读 · 0 评论 -
POJ 2502-Subway(最短路水题)
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want ...原创 2018-09-29 13:54:00 · 445 阅读 · 1 评论