Colossal Fibonacci Numbers!
The i'th Fibonacci number f (i) is recursively defined in the following way:
f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0
Your task is to comput...
分类:
其他好文 时间:
2014-08-15 17:55:09
阅读次数:
241
题目一:根据电话上字母和数字的对应关系,用一个有意义的单词来表述一个电话号码,如用computer表示26678837
题目二:反过来,给定一个电话号码,是否可以用一个单词来表示呢?怎样表示最快呢?显然不是所有的电话号码都可以对应到单词上去
首先来看看leetcode上一个类似的题目:
Letter Combinations of a Phone Number
G...
分类:
其他好文 时间:
2014-08-15 16:11:50
阅读次数:
257
原题:
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it withou...
分类:
其他好文 时间:
2014-08-15 14:46:48
阅读次数:
207
Problem Description
Teacher Mai has an integer x.
He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i.
He w...
分类:
其他好文 时间:
2014-08-15 14:41:45
阅读次数:
165
题意很简单了,对一个区间有两种操作:
1. "C A B C" Color the board from segment A to segment B with color C.
//A~B涂上颜色C
2. "P A B" Output the number of different colors painted between segment A and segment B (includ...
分类:
其他好文 时间:
2014-08-15 14:39:58
阅读次数:
292
扫描枪实际上就是一输入设备,只不过它每次在输入的内容后面添加一个回车。因此在web中可以使用js监听回车事件。处理代码如下:jQuery(function() { jQuery(document).on('keydown','.card_number', function(e){ e = e|...
分类:
Web程序 时间:
2014-08-15 12:49:18
阅读次数:
183
1、NaN(not a number)非数字、不和任何数字相等,包括自己本身,可以用isNaN()判断,当praseInt()和praseFloat()不能解析时返回NaN。NaN为number对象下的一个属性,number.NaN typeof(NaN) //return number Na...
分类:
Web程序 时间:
2014-08-15 12:31:48
阅读次数:
241
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4937
搜索
机智的暴力...
分类:
其他好文 时间:
2014-08-15 10:46:38
阅读次数:
186
点击打开链接
Number Transformation
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 495 Accepted Submission(s): 248
Problem Descr...
分类:
其他好文 时间:
2014-08-15 10:46:08
阅读次数:
200
Description
Stable Grid
Consider a grid of size n x n where each cell contains a number. Let's call a grid stable if we canrearrange the numbers of each row so that every col...
分类:
其他好文 时间:
2014-08-15 10:42:58
阅读次数:
190