There are n cities and n?-?1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads. Theon a ...
分类:
其他好文 时间:
2020-01-18 16:46:11
阅读次数:
79
A. Lorenzo Von Matterhorn B.Minimum spanning tree for each edge C.Misha, Grisha and Underground D.Fools and Roads E.City Driving 题意:给你一颗基环树(有n条边,n个点的连 ...
分类:
其他好文 时间:
2020-01-18 15:00:58
阅读次数:
97
https://vjudge.net/contest/351913#problem/H N cities (2 ≤ N ≤ 10 000 ) are connected by a network of M one-way roads (1 ≤ M < 100 000 000 ). It is kno ...
分类:
其他好文 时间:
2020-01-15 10:04:28
阅读次数:
119
思想 从起点出发,标记走过的点,如果发现没有走过的点,随便选一个向前走,无路可走就回退。 应用 判断从V出发能否走到终点 判断从V出发能否走到终点,若能,记录路径 3、 "ROADS" 很多时候,并不需要一条路走到黑,这就是深搜中的 剪枝 。 4、 "生日蛋糕" "练习1" "练习2" "练习3" ...
分类:
其他好文 时间:
2020-01-01 23:40:22
阅读次数:
105
给定一个 n 点 m 条边的无向连通图,每条边的边权为 a 或 b。
对于 1 ~ n 中的每一个 i,求在所有可能的最小生成树中 1 -> i 的最短路的最小值。 ...
分类:
其他好文 时间:
2019-11-13 20:39:05
阅读次数:
107
题目链接:https://vjudge.net/problem/POJ-2421 思路:一些村庄,建一些路,使得所有村庄能相连,而且使得所有路长度之和最短。 题目说了,有些村庄之间已经建了路,说明有些路我们不需要建,那么在预处理的时候 把那些已经建过边的两个村庄的距离赋值为0,那么在跑最小生成树板子 ...
分类:
其他好文 时间:
2019-11-08 20:43:44
阅读次数:
91
POJ-1251 Jungle Roads (水题,%c)POJ-1287 Networking (水)POJ-2031 Building a Space Station (%f浮点数尴尬精度,两球间距离)POJ-2421 Constructing Roads (一些边已建好,简单处理一下)ZOJ-... ...
分类:
其他好文 时间:
2019-10-22 11:23:38
阅读次数:
102
HDU - 3018 Ant Country consist of N towns.There are M roads connecting the towns. Ant Tony,together with his friends,wants to go through every part of ...
分类:
其他好文 时间:
2019-10-19 20:29:38
阅读次数:
113
这是一场比赛的 T4T4 ,身为蒟蒻的我当然没有想出来。 后来对基环树有了一点了解之后就来肝这道题。 首先对于一条边,只有两种情况 1.在环上,那么这个环只有全部正向或全部反向才可以成立,而总方案数显然是 2m ,其中 mm 是环上的边数,所以方案数就是 2m-2 2.不在环上,那么这种边就可以随意 ...
分类:
其他好文 时间:
2019-10-05 22:49:38
阅读次数:
111
带飞网址: https://vjudge.net/article/187 专题六: POJ 1251 Jungle RoadsPOJ 1287 NetworkingPOJ 2031 Building a Space StationPOJ 2421 Constructing RoadsZOJ 1586 ...
分类:
其他好文 时间:
2019-10-05 20:02:04
阅读次数:
114