摘要: 原题:http://acm.hdu.edu.cn/showproblem.php?pid=1671Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem 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 catalogue listed 阅读全文
posted @ 2011-06-28 23:04 ljsspace 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 原题: http://poj.org/problem?id=3002DescriptionBill has found the perfect way to make money playing the slot machines. After months of careful research, he has finally figured out the mechanics behind how the machines operate. Now he is ready to make profit of his findings.But first an introduction to 阅读全文
posted @ 2011-06-28 00:08 ljsspace 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 原题:http://topic.csdn.net/u/20110623/10/0324c75e-f72a-4894-83e9-f5a00fc88f62.html?85618描述:有k个正整数 任取其中k-1个数 找到一个他们的最小公倍数数N 求N的最小值分析:可以采用以下三种方法:******************************1) 方法一:(缺点:需对k个数做质因素分解)基本想法是先对每个数做质因素分解,然后对k-1个数两两相互统计,找出它们对应质因子的最大个数,最后当所有k-1个数统计结束时,结果就是该质因子个数的最大值,然后将这些质因子相乘(个数>=1,需要重复相乘), 阅读全文
posted @ 2011-06-28 00:05 ljsspace 阅读(501) 评论(1) 推荐(0) 编辑
摘要: 原题:http://acm.hdu.edu.cn/showproblem.php?pid=1251Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束.Output对于每个提问,给出以该字 阅读全文
posted @ 2011-06-28 00:01 ljsspace 阅读(522) 评论(0) 推荐(0) 编辑