随笔分类 - 图论
摘要:Cow ContestTime Limit:1000MSMemory Limit:65536KTotal Submissions:5989Accepted:3234DescriptionN(1 ≤N≤ 100) cows, conveniently numbered 1..N, are partic...
阅读全文
摘要:Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和...
阅读全文
摘要:Nearest Common AncestorsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 19919Accepted: 10544DescriptionA rooted tree is a well-known data str...
阅读全文
摘要:int V; //顶点数量vector G[max_v]; //图的邻接表表示方法vector rG[max_v]; //把边反向建的图vector vs; //后序遍历顺序的顶点列表bool used[max_v]; //访问标记int cmp[max_v]; ...
阅读全文
摘要:J - Underground Cables Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVALive 4872DescriptionA city wants to get...
阅读全文
摘要:1078 最小生成树 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 白银 Silver 题目描述 Description农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场。当然,他需要你的 帮助。 约翰已经给他的农场安排了一条高速的网络...
阅读全文