摘要: java可迭代的集合类型使用foreach语 句的学习笔记。 阅读全文
posted @ 2013-11-03 14:34 兰幽 阅读(892) 评论(0) 推荐(0) 编辑
摘要: 深度优先用法之检测有无环 阅读全文
posted @ 2013-11-03 14:32 兰幽 阅读(2214) 评论(0) 推荐(0) 编辑
摘要: 深度优先用法之查找联通分量 阅读全文
posted @ 2013-11-01 19:51 兰幽 阅读(1540) 评论(0) 推荐(0) 编辑
摘要: 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? 阅读全文
posted @ 2013-10-23 00:22 兰幽 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Problem Description Calculate S(n). S(n)=13+23 +33 +......+n3 . 阅读全文
posted @ 2013-09-15 18:50 兰幽 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 小Q系列故事——电梯里的爱情  细心的同事发现,小Q最近喜欢乘电梯上上下下,究其原因,也许只有小Q自己知道:在电梯里经常可以遇到他心中的女神HR。   电梯其实是个很暧昧的地方,只有在电梯里,小Q才有勇气如此近距离接近女神,虽然觉得有点不自在,但次数多了,女神也习惯了小Q的存在,甚至熟悉到仿佛不说上句话自己也都觉得不合适了。可是,他们的谈话也仅仅限于今天天气不错啊或是你吃了吗之类的,往往在对方微笑点头后就再次陷入难堪的沉默之中。 于是,小Q便在陪伴女神的同时,也关注着电梯中显示的楼层数字,并且他注意到电梯每向上运行一层需要6秒钟,向下运行一层需要4秒钟,每开门一次需要5秒(如果有人到达才开门),并且每下一个人需要加1秒。   特别指出,电梯最开始在0层,并且最后必须再回到0层才算一趟 阅读全文
posted @ 2013-09-13 00:59 兰幽 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 有如下方程:Ai = (Ai-1 + Ai+1)/2 - Ci (i = 1, 2, 3, .... n). 若给出A0, An+1, 和 C1, C2, .....Cn. 请编程计算A1 = ? 阅读全文
posted @ 2013-09-13 00:18 兰幽 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. 阅读全文
posted @ 2013-09-06 23:12 兰幽 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Problem Description The 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 resulting value contains two or more digits, those digits are summed and the process is repeated. This is continued as long as necessary to obtain a single digit. For example, consider the positive integer 24. Adding the 2 and the 4 yields a value of 6. Since 6 is a single digit, 6 is the digital root of 阅读全文
posted @ 2013-09-06 22:49 兰幽 阅读(307) 评论(0) 推荐(0) 编辑
摘要: Problem Description HD1000A + B Problem Calculate A + B. Input 阅读全文
posted @ 2013-09-06 22:32 兰幽 阅读(316) 评论(0) 推荐(0) 编辑