图论
文章平均质量分 78
_荷塘涟漪
这个作者很懒,什么都没留下…
展开
-
【最长链】wikioi1814
最长链 现给出一棵N个结点二叉树,问这棵二叉树中最长链的长度为多少,保证了1号结点为二叉树的根。输入描述输入的第1行为包含了一个正整数N,为这棵二叉树的结点数,结点标号由1至N。接下来N行,这N行中的第i行包含两个正整数l[i], r[i],表示了结点i的左儿子与右儿子编号。如果l[i]为0,表示结点i没有左儿子,同样地,如果r[i]为0则表示没有右儿子。原创 2014-10-06 23:16:43 · 339 阅读 · 0 评论 -
【kruskal+最小偏心距】wiki1700施工方案第二季
施工方案第二季 c国边防军在边境某处的阵地是由n个地堡组成的。工兵连受命来到阵地要进行两期施工。第一期的任务是挖掘暗道让所有地堡互联互通。现已勘测设计了m条互不相交的暗道挖掘方案,如果这m条暗道都实施挖掘,肯定能达到互联互通的目的。事实上,适当选择其中n-1个方案挖掘,就能实现互联互通,即从每个地堡出发都能到达其他任何一个地堡(允许经过别的地堡)。连长精心谋算,在m个设原创 2014-10-06 23:00:44 · 939 阅读 · 0 评论 -
【bellman_ford】poj2240
ArbitrageDescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that原创 2014-10-06 23:27:14 · 282 阅读 · 0 评论 -
【spfa(栈)或者 堆优dijkstra】poj3159
CandiesDescriptionDuring 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 flymo原创 2014-10-06 23:28:52 · 301 阅读 · 0 评论