上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 46 下一页
摘要: 斐波那契数列的定义如下: F(0) = 0 F(1) = 1 F(n) = F(n - 1) + F(n - 2) (n >= 2) (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...) 给出n,求F(n),由于结果很大,输出F(n) 阅读全文
posted @ 2017-08-09 10:43 starry_sky 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。 例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。 Input Output Input示例 Output示例 阅读全文
posted @ 2017-08-08 21:14 starry_sky 阅读(246) 评论(0) 推荐(0) 编辑
摘要: n的阶乘后面有多少个0? 6的阶乘 = 1*2*3*4*5*6 = 720,720后面有1个0。 Input Output Input示例 Output示例 阅读全文
posted @ 2017-08-08 19:46 starry_sky 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 一个高度为N的由正整数组成的三角形,从上走到下,求经过的数字和的最大值。 每次只能走到下一层相邻的数上,例如从第3层的6向下走,只能走到第4层的2或9上。 5 8 4 3 6 9 7 2 9 5 例子中的最优方案是:5 + 8 + 6 + 9 = 28 一个高度为N的由正整数组成的三角形,从上走到下 阅读全文
posted @ 2017-08-08 18:16 starry_sky 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=6090 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he 阅读全文
posted @ 2017-08-08 17:57 starry_sky 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Problem Description You are the hero who saved your country. As promised, the king will give you some cities of the country, and you can choose which 阅读全文
posted @ 2017-08-08 11:58 starry_sky 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Problem Description 哗啦啦村袭击了喵哈哈村!度度熊为了拯救喵哈哈村,带着自己的伙伴去救援喵哈哈村去了!度度熊与伙伴们很快的就过来占据了喵哈哈村的各个军事要地,牢牢的守住了喵哈哈村。但是度度熊发现,这是一场旷日持久的战斗,所以度度熊决定要以逸待劳,保存尽量多的体力,去迎战哗啦啦村的 阅读全文
posted @ 2017-08-07 21:27 starry_sky 阅读(757) 评论(1) 推荐(0) 编辑
摘要: Description Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bes 阅读全文
posted @ 2017-08-07 17:29 starry_sky 阅读(232) 评论(0) 推荐(0) 编辑
摘要: double EPS = 1e-10; double add(double a,double b) { if(abs(a+b) < EPS * (abs(a) + abs(b))) return 0; return a + b; } struct Point{ double x, y; Point(){} Point(double x, double y)... 阅读全文
posted @ 2017-08-07 16:29 starry_sky 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbitrarily on the floor and would 阅读全文
posted @ 2017-08-07 16:01 starry_sky 阅读(208) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 46 下一页