zhber
有好多做过的题没写下来,如果我还能记得就补吧

随笔分类 -  图论

cf21D Traveling Graph
摘要:You are given undirected weighted graph. Find the length of the shortest cycle which starts from the vertex 1 and passes throught all the edges at lea 阅读全文
posted @ 2017-07-24 16:53 zhber 阅读(350) 评论(0) 推荐(0)
bzoj4097 [Usaco2013 dec]Vacation Planning
摘要:DescriptionAir Bovinia is planning to connect the N farms (1 3, and from 1->2. Sample Output224OUTPUT DETAILS: The trip from 3->2 has only one possibl... 阅读全文
posted @ 2015-09-28 22:54 zhber 阅读(304) 评论(0) 推荐(0)
bzoj2208 [Jsoi2010]连通数
摘要:DescriptionInput输入数据第一行是图顶点的数量,一个正整数N。 接下来N行,每行N个字符。第i行第j列的1表示顶点i到j有边,0则表示无边。Output输出一行一个整数,表示该图的连通数。Sample Input3 010 001 100 Sample Output9HINT对于100... 阅读全文
posted @ 2015-01-11 10:56 zhber 阅读(175) 评论(0) 推荐(0)
bzoj2438 [中山市选2011]杀人游戏
摘要:Description一位冷血的杀手潜入 Na-wiat,并假装成平民。警察希望能在 N 个人里面,查出谁是杀手。警察能够对每一个人进行查证,假如查证的对象是平民,他会告诉警察,他认识的人, 谁是杀手, 谁是平民。 假如查证的对象是杀手, 杀手将会把警察干掉。现在警察掌握了每一个人认识谁。每一个人都... 阅读全文
posted @ 2015-01-02 12:23 zhber 阅读(246) 评论(0) 推荐(0)
poj3177 Redundant Paths
摘要:DescriptionIn order to get from one of the F (1 2 and 1 –> 6 –> 5 –> 21 – 4: 1 –> 2 –> 3 –> 4 and 1 –> 6 –> 5 –> 43 – 7: 3 –> 4 –> 7 and 3 –> 2 –> 5 ... 阅读全文
posted @ 2014-12-20 21:49 zhber 阅读(159) 评论(0) 推荐(0)
poj1236 Network of Schools
摘要:DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list o... 阅读全文
posted @ 2014-12-20 21:22 zhber 阅读(163) 评论(0) 推荐(0)
bzoj2427 [HAOI2010]软件安装
摘要:Description现在我们的手头有N个软件,对于一个软件i,它要占用Wi的磁盘空间,它的价值为Vi。我们希望从中选择一些软件安装到一台磁盘容量为M计算机上,使得这些软件的价值尽可能大(即Vi的和最大)。但是现在有个问题:软件之间存在依赖关系,即软件i只有在安装了软件j(包括软件j的直接或间接依赖... 阅读全文
posted @ 2014-12-14 12:46 zhber 阅读(187) 评论(0) 推荐(0)
bzoj2427 [HAOI2010]软件安装
摘要:Description现在我们的手头有N个软件,对于一个软件i,它要占用Wi的磁盘空间,它的价值为Vi。我们希望从中选择一些软件安装到一台磁盘容量为M计算机上,使得这些软件的价值尽可能大(即Vi的和最大)。但是现在有个问题:软件之间存在依赖关系,即软件i只有在安装了软件j(包括软件j的直接或间接依赖... 阅读全文
posted @ 2014-12-14 12:46 zhber 阅读(148) 评论(0) 推荐(0)
bzoj1654 [Usaco2006 Jan]The Cow Prom 奶牛舞会
摘要:DescriptionThe N (2 #include#include#include#include#include#include#include#include#include#include#define LL long long#define inf 0x7ffffff#define p... 阅读全文
posted @ 2014-10-03 20:56 zhber 阅读(211) 评论(0) 推荐(0)
codevs2822 爱在心中
摘要:2822 爱在心中 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题目描述 Description “每个人都拥有一个梦,即使彼此不相同,能够与你分享,无论失败成功都会感动。爱因为在心中,平凡而不平庸,世界就像迷宫,却又让我们此刻相逢Our Home。” 在 阅读全文
posted @ 2014-09-20 20:20 zhber 阅读(195) 评论(0) 推荐(0)
bzoj1051 [HAOI2006]受欢迎的牛
摘要:Description每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头牛被所有的牛认为是受欢迎的。Input第一行两个数N,M。 接下来... 阅读全文
posted @ 2014-09-20 13:05 zhber 阅读(212) 评论(0) 推荐(0)
poj1330 Nearest Common Ancestors
摘要:Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is la... 阅读全文
posted @ 2014-09-18 16:46 zhber 阅读(141) 评论(0) 推荐(0)