上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 66 下一页
摘要: 病毒侵袭持续中Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1663Accepted Submission(s): 611Problem Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打没有准 阅读全文
posted @ 2011-09-07 09:56 沐阳 阅读(1718) 评论(0) 推荐(0) 编辑
摘要: Immediate DecodabilityAn encoding of a set of symbols is said to be immediatelydecodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary, that no two codes within a set of codes are the same, that each code has at le. 阅读全文
posted @ 2011-09-07 00:10 沐阳 阅读(790) 评论(0) 推荐(0) 编辑
摘要: 该题题意是求给定的字符串集用一个打字机来打出所有的字符串(最后一个),顺序可以打乱,每次操作可以向打字机的末尾添加一个字符删除一个字符以及打印一个单词。这里有一个很强大的想法,那就是先假设每个单词都打印出来起消耗为 sumlenth * 2 + N,在统计所有的相同的字符数 M, 然后得到最长的一个单词的长度L,把这个单词的放在最后打印,最后答案就是 sumlen * 2 + N - M. 代码如下: 1 #include <cstdlib> 2 #include <cstdio> 3 #include <cstring> 4 using namespace 阅读全文
posted @ 2011-09-06 17:21 沐阳 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Problem B: Ultra-QuickSortIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. For the input sequence9 1 0 5 4,Ultra-QuickSort produce 阅读全文
posted @ 2011-09-06 14:50 沐阳 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 病毒侵袭Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2438Accepted Submission(s): 627Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他 阅读全文
posted @ 2011-09-04 11:19 沐阳 阅读(767) 评论(0) 推荐(0) 编辑
摘要: Keywords SearchTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10744Accepted Submission(s): 3722Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to 阅读全文
posted @ 2011-09-04 03:04 沐阳 阅读(848) 评论(0) 推荐(0) 编辑
摘要: Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43278Accepted Submission(s): 9449Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to 阅读全文
posted @ 2011-09-04 00:13 沐阳 阅读(10132) 评论(0) 推荐(3) 编辑
摘要: 该题就是判定一个所给定串集中是否有某些串是另外一些串的前缀串的问题。字典树的话很好办只要判定在构建一个串的路径中是否已经有的节点被标记(此处有串结尾)和如果一个串在该处结尾,那么是否它的的孩子都为空。 这里写了一个暴力版,即现将所给定的所有数字用long long型存储起来,再按从小到大的顺序进行排序,之后再判定一个字符串以及它的依次去掉末位的子串是否已经存在,如果存在则输出NO,否则输出YES。在这里有一个如果不做一些处理的话是会WA的,那就是在每个数组之前加上一个1,这样使的串中的前导零有意义。 代码如下: 1 #include <cstring> 2 #include < 阅读全文
posted @ 2011-09-03 22:28 沐阳 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Exchange RatesTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 157Accepted Submission(s): 89Problem DescriptionNow that the Loonie is hovering about par with the Greenback, you have decided to use your $1000 entrance scholarship to engage in currenc 阅读全文
posted @ 2011-09-02 16:56 沐阳 阅读(508) 评论(0) 推荐(0) 编辑
摘要: Common SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9595Accepted Submission(s): 3923Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x 阅读全文
posted @ 2011-08-31 23:57 沐阳 阅读(5947) 评论(0) 推荐(1) 编辑
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 66 下一页