Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13390 Accepted Submission(s): 5018 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peo…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13390 Accepted Submission(s): 5018 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peo…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13390 Accepted Submission(s): 5018 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peo…
寒冰王座 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13177    Accepted Submission(s): 6718 Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4822 Problem Description Three countries, Red, Yellow, and Blue are in war. The map of battlefield is a tree, which means that there are N nodes and (N – 1) edges that connect all the nodes. Each country…
畅通工程续 Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 88   Accepted Submission(s) : 48 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路.不过路…
看题传送门 吐槽题目 叫什么很O_O的汉诺塔我还@.@呢. 本来是想过一段时间在来写题解的,不过有人找我要. 本来排名是第8的.然后搞了半天,弄到了第五.不过代码最短~ 截止目前就9个ID过,小小的成就感~ PS用G++内存小... Rank Author Exe. Time Exe. Memory Code Len. Language Date 1 4bytes 0MS 204K 1961B C++ 2011-07-30 22:15:19 2 sunhaowen 0MS 212K 895B G…
[题目] 输入二叉树中的两个结点,输出这两个结点在数中最低的共同父结点. 二叉树的结点定义如下:  C++ Code  123456   struct BinaryTreeNode {     int value;     BinaryTreeNode *left;     BinaryTreeNode *right; }; [分析] 求数中两个结点的最低共同结点是面试中经常出现的一个问题.这个问题有几个变种. [变种1] 第一个变种是二叉树是一种特殊的二叉树:查找二叉树.也就是树是排序过的,位…
Bellovin Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepted Submission(s): Problem Description Peter has a sequence a1,a2,...,an and he define a function on the sequence -- F(a1,a2,...,an)=(f1,f2,...,fn), whe…
Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).   Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串. 注意:本题只有一组测试数据,处理到文件结束.   Output 对…