Description N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length an ...
分类:
其他好文 时间:
2018-08-19 20:56:13
阅读次数:
183
题意:有一个村庄网络(图),求该图的最小生成树 首先输入n代表n个村庄,接下来的n-1行,每行首先输入一个大写字母表示一个村庄,接着输入一个数字num, 表示和村庄连接的点的个数 接下来输入num对大写字母和数字,表示该村庄到另一个村庄的距离。比如:题目的第二组数组 表示:有三个村庄 A村庄有两个连 ...
分类:
其他好文 时间:
2018-08-16 19:41:50
阅读次数:
206
可能是正式做过的第一个搜索吧(感谢pojQ_Q) 发个博客纪念一下 ...
分类:
其他好文 时间:
2018-08-16 01:05:18
阅读次数:
171
题目大意 给出一个有向图,给出起点和终点,问每条边,是否图中存在的每一条起点到终点的最短路径都经过它(条件YES),如果存在不经过它的最短路径,可以减小它的多少边权(减少量不得超过该边原来的边权)使得该边满足条件YES。 题解 我们规定图中起点到终点的所有最短路径所经过的点、边构成的子图叫做最短路径 ...
分类:
其他好文 时间:
2018-08-10 23:24:11
阅读次数:
202
// constructing sets #include #include #include bool fncomp (int lhs, int rhs) {return lhs first; // empty set of ints int myints[]= {10,20,30,40,50};... ...
分类:
编程语言 时间:
2018-08-09 13:52:33
阅读次数:
214
传送门:>Here< 题意:给出一张无向图(边权为1),并给出两对起点和终点以及距离:s1,t1,l1; s2,t2,l2; 要求删除尽量多的边,使得dis(s1,t1)<=l1, dis(s2,r2)<=l2 解题思路 首先我们会发现,由于边权都为1,删去一些边,某两点间的最短路肯定会随着删的边越 ...
分类:
其他好文 时间:
2018-08-02 11:25:42
阅读次数:
144
题目链接: https://cn.vjudge.net/problem/POJ-1724 N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associ ...
分类:
其他好文 时间:
2018-07-28 20:33:11
阅读次数:
208
题目描述 In the country there are n n n cities and m m m bidirectional roads between them. Each city has an army. Army of the i i i -th city consists of a ...
分类:
其他好文 时间:
2018-07-23 20:22:06
阅读次数:
223
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and ...
分类:
其他好文 时间:
2018-07-23 17:23:50
阅读次数:
108
``` You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b such that there are exactly a zeroes, exactly ...
分类:
其他好文 时间:
2018-07-22 00:10:00
阅读次数:
235