上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: Description Given 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), t... 阅读全文
posted @ 2014-12-11 19:09 星斗万千 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gift because you will get married next year. ... 阅读全文
posted @ 2014-12-11 18:20 星斗万千 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Description Bob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and dec... 阅读全文
posted @ 2014-12-04 17:44 星斗万千 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Description Background Bill, Steve and Linus participate in programming contests just like the one you're competing in right now. They have diffe... 阅读全文
posted @ 2014-12-04 17:43 星斗万千 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Description The widget factory produces several different kinds of widgets. Each widget is carefully built by a skilled widgeteer. The time required... 阅读全文
posted @ 2014-11-24 19:56 星斗万千 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 容斥原理是一种重要的组合数学方法,可以让你求解任意大小的集合,或者计算复合事件的概率。 定理: 在计数时,必须注意无一重复,无一遗漏。为了使重叠部分不被重复计算,人们研究出一种新的计数方法,这种方法的基本思想是:先不考虑重叠的情况,把包含于某内容中的所有对象的数目先计算... 阅读全文
posted @ 2014-11-19 22:32 星斗万千 阅读(2343) 评论(0) 推荐(0) 编辑
摘要: 一。在数论,对正整数n,欧拉函数是小于或等于n的数中与n互质的正整数(包括1)的数目。 例如φ(8)=4,因为1,3,5,7均和8互质。 φ函数的值 通式:φ(x)=x (1-1/p1) (1-1/p2) (1-1/p3) (1-1/p4)…..(1-1/pn),其中p1, p... 阅读全文
posted @ 2014-11-19 15:34 星斗万千 阅读(335) 评论(0) 推荐(0) 编辑
摘要: Description Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division... 阅读全文
posted @ 2014-11-18 23:42 星斗万千 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Theorem For any two integers x and k there exists two more integers p and q such that: It’s a fairly easy task to prove this theorem, so we’d n... 阅读全文
posted @ 2014-11-17 21:12 星斗万千 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。 基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。 第一种证明: a可以表示成a = kb + r,则r = a mod b 假设... 阅读全文
posted @ 2014-11-17 19:20 星斗万千 阅读(162) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页