随笔分类 - 

摘要:适用 含负权边的有向图的单源最短路径问题 不能处理带负权边的无向图和包含权值总和为负值的回路 数据结构 dist[u] :源点到u的最短路径长度 思路 每次更新dist数组,使得 dist[u] 的含义是从源点到u的经过n条边的最短路径长度 递推公式 $Dist^k[u]=min(dist^{k-1 阅读全文
posted @ 2018-12-30 19:14 TobicYAL 阅读(386) 评论(0) 推荐(0)
摘要:数据结构 dfn[i] :编号为i的结点在dfs遍历图的过程中的访问序号(开始时间) low[i] :从i结点出发dfs过程中i下方的结点能到达的最早的当前搜索路径上的结点的开始时间。(初始时 low[i]=dfn[i] ) 操作 遍历结点没被访问过的就开始dfs,碰到哪个结点哪个结点就入栈,栈中结 阅读全文
posted @ 2018-12-30 18:01 TobicYAL 阅读(649) 评论(0) 推荐(0)
摘要:题目描述 Farmer John has noticed that his cows often move between nearby fields. Taking this into account, he wants to plant enough grass in each of his f 阅读全文
posted @ 2018-12-22 11:13 TobicYAL 阅读(178) 评论(0) 推荐(0)
摘要:描述 Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all 阅读全文
posted @ 2018-11-26 19:33 TobicYAL 阅读(297) 评论(0) 推荐(0)
摘要:描述 FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths ru 阅读全文
posted @ 2018-11-26 19:29 TobicYAL 阅读(239) 评论(0) 推荐(0)
摘要:描述 As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers 阅读全文
posted @ 2018-11-23 18:19 TobicYAL 阅读(277) 评论(0) 推荐(0)
摘要:兔子与星空(10分) 题目内容: 很久很久以前,森林里住着一群兔子。兔子们无聊的时候就喜欢研究星座。如图所示,天空中已经有了n颗星星,其中有些星星有边相连。兔子们希望删除掉一些边,然后使得保留下的边仍能是n颗星星连通。他们希望计算,保留的边的权值之和最小是多少? 输入格式: 第一行只包含一个表示星星 阅读全文
posted @ 2018-11-20 15:41 TobicYAL 阅读(1012) 评论(0) 推荐(0)
摘要:描述 Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis 阅读全文
posted @ 2018-11-16 18:42 TobicYAL 阅读(254) 评论(0) 推荐(0)
摘要:描述 Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exch 阅读全文
posted @ 2018-11-16 18:38 TobicYAL 阅读(251) 评论(0) 推荐(0)
摘要:描述 Caocao was defeated by Zhuge Liang and ZhouYu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, s 阅读全文
posted @ 2018-11-08 09:53 TobicYAL 阅读(351) 评论(0) 推荐(0)
摘要:描述 In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each 阅读全文
posted @ 2018-11-08 09:47 TobicYAL 阅读(316) 评论(0) 推荐(0)
摘要:描述 Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) o 阅读全文
posted @ 2018-11-08 09:31 TobicYAL 阅读(289) 评论(0) 推荐(0)