摘要:
彩色棒时间限制: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
可笑痴狂
阅读(352)
评论(0)
推荐(0)
摘要:
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
可笑痴狂
阅读(1610)
评论(0)
推荐(0)
摘要:
统计难题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
可笑痴狂
阅读(519)
评论(0)
推荐(0)
摘要:
士兵杀敌(五)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为0~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情。在这样的情况下,南将军却经常会在许多次战役之后询问军师小工第i号士兵到第j号士兵所有人的总军功数。请你帮助军师小工回答南将军的提问。输入只有一组测试数据第一行是三个整数N,C,Q(1<=N,C,Q<=1000000),其中N表示士兵的总数。随 阅读全文
posted @ 2012-08-09 11:51
可笑痴狂
阅读(436)
评论(0)
推荐(0)