
ACM
文章平均质量分 52
游刃有余则成
这个作者很懒,什么都没留下…
展开
-
2586 How far away ?
Problem DescriptionThere are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house原创 2013-04-05 21:50:17 · 845 阅读 · 0 评论 -
卡特兰数
什么是Catalan数说到Catalan数,就不得不提及Catalan序列,Catalan序列是一个整数序列,其通项公式是我们从中取出的就叫做第n个Catalan数,前几个Catalan数是:1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670,转载 2013-04-23 09:49:34 · 765 阅读 · 0 评论 -
1010 Tempter of the Bone
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 39780 Accepted Submission(s): 10761原题链接:点击打开链接Problem Desc转载 2013-03-27 16:01:33 · 425 阅读 · 0 评论 -
1013 Digital Roots
Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result原创 2013-03-27 18:05:31 · 644 阅读 · 0 评论 -
1009 FatMouse' Trade
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room con原创 2013-03-26 17:09:16 · 502 阅读 · 0 评论 -
1003
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +原创 2013-03-25 11:38:46 · 487 阅读 · 0 评论 -
1002 A + B Problem II
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<原创 2013-03-25 09:46:20 · 480 阅读 · 0 评论 -
An Easy Task
InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.Each test case contains two positive integers Y原创 2013-03-23 22:56:40 · 1243 阅读 · 0 评论 -
Lowest Bit
Problem DescriptionGiven an positive integer A (1 For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.Another example g原创 2013-03-23 23:48:18 · 563 阅读 · 0 评论 -
ASCII
Problem DescriptionSince all we know the ASCII code, your job is simple: input numbers and output corresponding messages. InputThe first line contains one integer T (1The input will原创 2013-03-23 23:45:44 · 619 阅读 · 0 评论 -
Buildings
InputStandard input will contain multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.The first line of each test case co原创 2013-03-23 23:06:46 · 579 阅读 · 0 评论 -
Nasty Hacks
InputThe input consists of n cases, and the first line consists of one positive integer giving n. The next n lines each contain 3 integers, r, e and c. The first, r, is the expected revenue if you d原创 2013-03-23 22:18:16 · 604 阅读 · 0 评论 -
1.1.8 A+B for Input-Output Practice (VIII)
Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and原创 2013-03-23 11:19:00 · 620 阅读 · 0 评论 -
1.1.5 A+B for Input-Output Practice (V)
Problem DescriptionYour task is to calculate the sum of some integers. InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M,原创 2013-03-23 10:13:49 · 653 阅读 · 0 评论 -
多柱汉诺塔最优算法设计探究
引言汉诺塔算法一直是算法设计科目的最具代表性的研究问题,本文关注于如何设计多柱汉诺塔最优算法的探究。最简单的汉诺塔是三个柱子(A、B、C),因此多柱汉诺塔的柱子个数M≥3。下面从三柱汉诺塔说起,慢慢深入我们要关心的问题。1. 三柱汉诺塔三柱汉诺塔是经典的汉诺塔问题,在算法设计中是递归算法的典型问题。其算法是这样的: 首先把A 柱上面的n- 1 个碟子通过C 柱移到B 柱上【T(n-1)转载 2013-05-15 20:35:49 · 1756 阅读 · 0 评论