- 博客(12)
- 收藏
- 关注
原创 Function
题目描述:Definea function f(n)=(f(n-1)+1)/f(n-2). You already got f(1) and f(2). Now, give youa number m, please find the value of f(m). Input There are several test cases. Each casecontains th
2013-08-01 10:35:07
452
转载 卡特兰数
什么是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-08-01 09:57:50
430
原创 Brackets
This year MK is 5 years old. So he decides to learnsome arithmetic. But he was confused by how towrite the brackets. He has already known that the brackets should match whenwriting them correctly. Suc
2013-07-17 18:09:11
417
原创 Arithmetic Progression
“In mathematics, an arithmeticprogression (AP) or arithmetic sequence is a sequence of numbers such that thedifference between the consecutive terms is constant. For instance, thesequence 5, 7, 9, 11,
2013-07-17 17:48:34
621
原创 Eming
Emingis a contest hold by WHUACM training team. The aim is to select new members ofthe team. Usually, the first problem is a very simpleproblem such as “a+b problem”. But this time, Xioumu is ti
2013-07-17 17:31:58
509
原创 ZZY的困惑
描述 ZZY爱足球~~爱音乐~~爱日剧~~爱电影~~爱A题~~爱萌妹~~总之ZZY喜欢做很多事情~~而且ZZY希望在这些爱好中能收获一些东西~~但是并不是所有爱好对所有目标都是起积极作用的..ZZY十分的困惑..于是ZZY列了下自己想获得的收获并且给每个目标设立了最小要达到的权值...并且给自己的爱好对每个收获目标进行了评值..这个值若是负则代表不利于获得某个收获~~为0代表没影响~~为正
2013-07-17 17:17:04
587
原创 ZZY的宠物
ZZY的宠物描述ZZY领养了一对刚刚出生的不知名小宠物..巨萌巨可爱!!...小宠物的生命为5个单位时间并且不会在中间出意外翘辫子(如: 从0出生能活到5但活不到6)..小宠物经过2个单位时间成熟..刚刚成熟的一对小宠物能立即生育6只新的小宠物(如: 从0出生的一对在2时成熟并进行第一次生育)...小宠物是很忠诚的..不会在中途换伴侣..每对小宠物生育一次这一对的生育能力就会降低2个..也
2013-07-13 21:19:51
449
原创 人见人爱A^BmodC
D人见人爱A^BmodC 计算A的B次幂对c取模(A^BmodC)并且1输入三个整数A,B,C,输入文件每一行依次三个整数a,b,c用空格隔开每行输出一个运算结果 Sample: Input:3 4 510 10 10045 67 891 1 1 Output:10450试题分析:这是第四题,是一道快速幂的模板
2013-07-11 17:18:05
822
原创 蜗牛!快爬!
C 蜗牛!快爬!Problem Description很久以前有一只蚂蚁,某天在路上走着走着,突然看见了一只蜗牛,爬的很慢。心想自己虽然比它小,可是跑得比它快,于是蚂蚁想跟蜗牛进行一次马拉松比赛,想证明它的实力。蚂蚁跟蜗牛商量后决定在星期六下午进行马拉松比赛。Theday is coming….比赛跑道为一条直线,Unlucky!!跑道上有很多坑。注意哦,坑!蜗牛想知道它掉下坑底后,爬
2013-07-11 16:32:52
539
原创 Strings of Power
B. Strings of PowerVolodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested in texts concerning his favourite music style.Volodya calls a strin
2013-07-11 12:00:15
422
原创 Even Odds
A. Even OddsBeing a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determine
2013-07-11 11:43:56
480
转载 快速幂(完整版)
快速幂取模算法在网站上一直没有找到有关于快速幂算法的一个详细的描述和解释,这里,我给出快速幂算法的完整解释,用的是C语言,不同语言的读者只好换个位啦,毕竟读C的人较多~所谓的快速幂,实际上是快速幂取模的缩写,简单的说,就是快速的求一个幂式的模(余)。在程序设计过程中,经常要去求一些大数对于某个数的余数,为了得到更快、计算范围更大的算法,产生了快速幂取模算法。我们先从简单的例子入手:求=
2013-07-11 11:33:08
536
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人