Problem Description 吉哥又想出了一个新的完美队形游戏!
假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ...
h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺...
分类:
其他好文 时间:
2014-05-10 19:42:07
阅读次数:
309
Problem DescriptionThere are n people and n
target, everyone should get one target, no two people get the same target, the
last one who get the target...
分类:
其他好文 时间:
2014-05-06 09:00:51
阅读次数:
354
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
原地址:http://game.ceeger.com/Unity/Doc/2011/Unity3D_For_Android.html我自认为抵挡诱惑的能力还是很强大的,关键的时候还能把持住自己。今天逛了一下南京的丹凤街,终于受不住Android这美眉的诱惑。她虽脸蛋不怎么滴,但身材火热,且性感,廉价...
分类:
移动开发 时间:
2014-05-05 22:18:52
阅读次数:
504
原地址:http://www.davebost.com/2013/08/30/creating-a-unity-game-for-windows-8Therecent
release of Unity 4.2brings with it full-support for deploying Unit...
原地址:http://digitalerr0r.wordpress.com/2013/09/30/unity-game-starter-kit-for-windows-store-and-windows-phone-store-games/Posted
onSeptember 30, 2013byd...
原地址: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...
本题因为数据量小,可以使用暴力法,时间效率是O(n^3)
但是这里巧用最大子段和的思想,可以把时间效率降到O(n)
思想:
1 想使用一个新的数列,计算连续出现了多少个1和连续出现了多少个零
2 求这个新数列的最大子段和
3 Flip最大子段中的 0 和 1,
4 计算出结果
比暴力法复杂很多了,但是时间效率却提高了三个档次。...
分类:
其他好文 时间:
2014-05-02 10:39:46
阅读次数:
584
leetcode, Jump Game , 递推求解...
分类:
其他好文 时间:
2014-05-02 05:10:22
阅读次数:
181