给出K*K的矩阵,每一行取一个数,构成K个数的和,总共有 k^k种可能,从中取出前k个最小的。一开始犯了错,因为只要对每行排序,最小的必定是第一列的和,然后我当时就想着,逐步推进,每次将某行的那个数变成其下一列那个数,当然间距要最小。我这样明显是不对的,这样的话每个数只用了一次,而题目的意思明显是可...
分类:
其他好文 时间:
2014-07-07 20:58:44
阅读次数:
188
Problem E: Jolly Jumpers
A sequence of n > 0 integers is called a jolly
jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1.
For ins...
分类:
其他好文 时间:
2014-07-03 17:40:42
阅读次数:
257
Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and ...
分类:
其他好文 时间:
2014-06-28 08:13:17
阅读次数:
249
一.DB(Data block)A data block is the smallest unit of storage in anOracledatabase. Every database has a default block size (specified when the database...
分类:
数据库 时间:
2014-06-25 14:20:00
阅读次数:
430
Redis是一种高级key-value数据库。它跟memcached类似,不过数据可以持久化,而且支持的数据类型很丰富。有字符串,链表,集 合和有序集合。支持在服务器端计算集合的并,交和补集(difference)等,还支持多种排序功能。所以Redis也可以被看成是一个数据结构服务 器。Redis的...
分类:
其他好文 时间:
2014-06-22 23:41:06
阅读次数:
269
题目:
Roman numerals come from the ancient Roman numbering system. They are based on specific letters of the alphabet which are combined to signify the sum (or, in some cases, the difference) of th...
分类:
其他好文 时间:
2014-06-20 12:27:09
阅读次数:
394
see also :http://www.w3school.com.cn/js/pro_js_inheritance_implementing.asphttp://davidshariff.com/blog/javascript-inheritance-patterns/Object masquer...
分类:
编程语言 时间:
2014-06-18 16:43:34
阅读次数:
239
Question: Mergeksorted linked lists and return
it as one sorted list. Analyze and describe its complexity.Solution: Find the
smallest list-head first....
分类:
其他好文 时间:
2014-06-10 19:51:30
阅读次数:
278
The only syntax difference between JSON and the
object literal is that property names need to be wrapped in quotes to be valid
JSON. In object literal...
分类:
编程语言 时间:
2014-06-02 09:31:41
阅读次数:
394
??
Description
Given N numbers, X1,
X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi
- Xj∣ (1 ≤ i
< j ≤ N). We can get C(N,2) differences through this work, and no...
分类:
其他好文 时间:
2014-06-01 14:07:56
阅读次数:
347