题目如下: There are n cities numbered from 0 to n-1 and n-1 roads such that there is only one way to travel between two different cities (this network for ...
分类:
其他好文 时间:
2020-06-22 15:47:54
阅读次数:
60
P2872 [USACO07DEC]Building Roads S【kruskal】 ...
分类:
其他好文 时间:
2020-06-21 11:43:33
阅读次数:
46
感谢sinian阿姨的热心指导 Description 这篇好久前写的,现在只是转过来,忘了 Solution 假设 $a \leq b$最小生成树上$a$边尽量要多,若a边不够将全图联通才用$b$边所以可以用$a$边将图连成多个联通块,再用$b$边将全图联通路径只要求在最小生成树上,且到不同点的最 ...
分类:
其他好文 时间:
2020-06-14 14:25:53
阅读次数:
65
ROADS 思路:K = 10000,djkstra复杂度O(nlogn),如果我们把不同点的不同花费拆点,即d[花费][点] = 距离,则被拆为 N*K个点,则djkstra复杂度O(k*n*logn),复杂度可以接受。 #include <iostream> #include <vector> ...
分类:
其他好文 时间:
2020-05-29 17:38:59
阅读次数:
40
#include <cmath> #include <cstdio> #include <iostream> #include <algorithm> using namespace std; const int N = 5000100; int n, m, cnt, fa[N], sum; dou ...
分类:
其他好文 时间:
2020-05-01 16:38:02
阅读次数:
54
题目 Farmer John正在一个新的销售区域对他的牛奶销售方案进行调查。他想把牛奶送到T个城镇 (1 <= T <= 25,000),编号为1T。这些城镇之间通过R条道路 (1 <= R <= 50,000,编号为1到R) 和P条航线 (1 <= P <= 50,000,编号为1到P) 连接。每 ...
分类:
编程语言 时间:
2020-04-30 19:32:03
阅读次数:
64
题目 $Farmer John$正在一个新的销售区域对他的牛奶销售方案进行调查。他想把牛奶送到$T$个城镇$(1 5,4 6$和$1 3$,花费分别是$ 100, 100, 10$。$FJ$的中心城镇在城镇$4$。 Sample Output NO PATH NO PATH 5 0 95 100 样 ...
分类:
其他好文 时间:
2020-04-29 20:26:49
阅读次数:
68
导语:我们上一篇介绍了jungle测试网的使用,可以说学习就是在不断试错,而测试网就是为了让我们在更接近于主网的环境中是试错,在测试环节中相当于UAT的测试环境了。但是,jungle测试网虽然老牌,而且有很多三方平台也提供了支持,但是使用成本还是很高,可以说仍然需要借助程序来使用,而对于小白用户来说... ...
分类:
其他好文 时间:
2020-04-29 12:55:37
阅读次数:
75
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag ...
分类:
其他好文 时间:
2020-04-19 10:48:26
阅读次数:
73
题目描述 In a village called Byteville, there are houses connected with N-1 roads. For each pair of houses, there is a unique way to get from one to anoth ...
分类:
其他好文 时间:
2020-04-07 18:17:31
阅读次数:
69