Problem Description 吉哥又想出了一个新的完美队形游戏!
假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ...
h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺...
分类:
其他好文 时间:
2014-05-10 19:42:07
阅读次数:
309
Link:http://oj.leetcode.com/problems/reverse-linked-list-ii/Reverse a linked
list from positionmton. Do it in-place and in one-pass.For example:Given1...
分类:
其他好文 时间:
2014-05-05 22:46:11
阅读次数:
411
1. introductionfrom numpy import
*random.rand(4,4)#array to matrixrandMat=mat(randon.rand(4,4))#matrix
inverseIvrandMat=randMat.I#indentity matrixeye(...
分类:
编程语言 时间:
2014-05-05 22:24:10
阅读次数:
336
原地址:http://digitalerr0r.wordpress.com/2013/08/27/unity-for-windows-ii-publishing-to-windows-8/Windows
8 is a new OS with a Windows Store where you can...
[问题2014S11] 设 \(A,B\) 为 \(n\) 阶实对称阵,
\(p(A),p(B),p(A+B)\) 分别为 \(A,B,A+B\) 的正惯性指数, 证明: \[p(A+B)\leq p(A)+p(B).\]
分类:
其他好文 时间:
2014-05-03 23:22:18
阅读次数:
256
hdu 1165 Eddy's research II (数学题,递推)...
分类:
其他好文 时间:
2014-05-03 15:34:41
阅读次数:
215
本文出自:http://blog.csdn.net/svitter
题意:汉诺塔,多了一根柱子,问你寻找最快的移动次数。
dp [ n ] = dp [ n - j ] * 2 + pow( 2, j ) - 1;
就是把j个汉诺塔移到一根上,然后就是普通的汉诺塔问题,即2^n - 1次移动。
注意pow(2, j )可能超出long long int范围。写二的次方的时候也可用移...
分类:
其他好文 时间:
2014-05-03 00:14:10
阅读次数:
342
Write an efficient algorithm that searches for
a value in anmxnmatrix. This matrix has the following properties:Integers in
each row are sorted from l...
分类:
其他好文 时间:
2014-05-02 10:41:53
阅读次数:
267
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
刚开始没有思路,但是自己举了几个简单的栗子才看出规律:需要一圈儿一圈儿的变换位置。有两层for循环:外...
分类:
其他好文 时间:
2014-05-01 18:33:34
阅读次数:
359