传话游戏(2013编程之美全国挑战赛资格赛)
摘要:传话游戏时间限制: 1000ms 内存限制: 256MB描述Alice和Bob还有其他几位好朋友在一起玩传话游戏。这个游戏是这样进行的:首先,所有游戏者按顺序站成一排,Alice站第一位,Bob站最后一位。然后,Alice想一句话悄悄告诉第二位游戏者,第二位游戏者又悄悄地告诉第三位,第三位又告诉第四位……以此类推,直到倒数第二位告诉Bob。两位游戏者在传话中,不能让其他人听到,也不能使用肢体动作来解释。最后,Bob把他所听到的话告诉大家,Alice也把她原本所想的话告诉大家。由于传话过程中可能出现一些偏差,游戏者越多,Bob最后听到的话就与Alice所想的越不同。Bob听到的话往往会变成一些很
阅读全文
posted @
2013-04-09 12:34
可笑痴狂
阅读(345)
推荐(0) 编辑
HDOJ 2094 产生冠军
摘要:产生冠军Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5027Accepted Submission(s): 2409Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能
阅读全文
posted @
2012-08-12 20:19
可笑痴狂
阅读(1748)
推荐(0) 编辑
POJ 2503 Babelfish 字典树
摘要:BabelfishTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 24994Accepted: 10703DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consist
阅读全文
posted @
2012-08-10 17:59
可笑痴狂
阅读(362)
推荐(0) 编辑
POJ -2513 Colored Sticks 字典树 + 并查集 + 欧拉路
摘要:Colored SticksTime Limit: 5000MSMemory Limit: 128000KTotal Submissions: 24844Accepted: 6542DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch
阅读全文
posted @
2012-08-10 17:06
可笑痴狂
阅读(235)
推荐(0) 编辑
HDOJ-1800 Flying to the Mars(贪心 + 字典树 + BST)
摘要:Flying to the MarsTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6271Accepted Submission(s): 2053Problem DescriptionIn the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns .
阅读全文
posted @
2012-08-10 16:28
可笑痴狂
阅读(1666)
推荐(0) 编辑
HDOJ-1075 What Are You Talking About 字典树查找
摘要:What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 7414Accepted Submission(s): 2292Problem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian
阅读全文
posted @
2012-08-10 11:44
可笑痴狂
阅读(1725)
推荐(0) 编辑
NYOJ-290 动物统计加强版 -----字典树
摘要:动物统计加强版时间限制:3000 ms | 内存限制:150000 KB难度:4描述在美丽大兴安岭原始森林中存在数量繁多的物种,在勘察员带来的各种动物资料中有未统计数量的原始动物的名单。科学家想判断这片森林中哪种动物的数量最多,但是由于数据太过庞大,科学家终于忍受不了,想请聪明如你的ACMer来帮忙。输入第一行输入动物名字的数量N(1<= N <= 4000000),接下来的N行输入N个字符串表示动物的名字(字符串的长度不超过10,字符串全为小写字母,并且只有一组测试数据)。输出输出这些动物中最多的动物的名字与数量,并用空格隔开(数据保证最多的动物不会出现两种以上)。样例输入10b
阅读全文
posted @
2012-08-10 09:28
可笑痴狂
阅读(533)
推荐(0) 编辑
NYOJ-236 彩色棒 字典树 + 并查集 + 欧拉路
摘要:彩色棒时间限制:1000 ms | 内存限制:128000 KB难度:5描述You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch are of the same color?输入the frist line have a number k(0<k&l
阅读全文
posted @
2012-08-09 21:52
可笑痴狂
阅读(348)
推荐(0) 编辑
HDOJ-1671 Phone List 字典树的应用----判断一组字符串中是否有一个字符串是另一个字符串的前缀(字典树第二类应用)。
摘要:Phone ListTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5081Accepted Submission(s): 1714Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone cata
阅读全文
posted @
2012-08-09 18:07
可笑痴狂
阅读(1605)
推荐(0) 编辑
HDOJ-1251 统计难题 字典树的应用-----统计一组字符串中某前缀出现次数(字典树第一类应用),
摘要:统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10380Accepted Submission(s): 4278Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统
阅读全文
posted @
2012-08-09 16:51
可笑痴狂
阅读(513)
推荐(0) 编辑