Descriptionbobo has a sequence a1,a2,…,an. He is allowed to swap twoadjacentnumbers for no more than k times.Find the minimum number of inversions aft...
分类:
其他好文 时间:
2015-08-09 20:18:38
阅读次数:
93
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?...
分类:
编程语言 时间:
2015-08-09 20:16:09
阅读次数:
134
DescriptionOnce Bob took a paper stripe ofnsquares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negativ...
分类:
其他好文 时间:
2015-08-09 20:13:24
阅读次数:
162
Minimum Inversion NumberProblem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisf...
分类:
其他好文 时间:
2015-08-09 18:23:51
阅读次数:
119
题目:丑数
* 我们把只包含因子2,3,5的数称为丑数(Ugly Number).
* 求按从小到大的顺序的第1500个丑数。
* 例如6,8都是丑数,但14不是,因为它含有因子7.习惯上我们把1当作第一个丑数
方法一:逐个判断每个整数是不是丑数的解法,直观但不够高效:
所谓一个数m是另一个数n的因子,是指n能被m整除,也就是说n%m==0.根据丑数的定义,丑数只能被2,3,5整除...
分类:
编程语言 时间:
2015-08-09 17:16:26
阅读次数:
151
仿支付宝/微信的密码输入框效果GridPasswordView解析,把一些设置和一些关键的地方列了出来,方便大家使用,可能可以省一部分的时间,也算是自己的积累吧。
1.密码框可以输入的类型PasswordType
public enum PasswordType {
NUMBER, TEXT, TEXTVISIBLE, TEXTWEB;
}
这里可以自行添加类型,然后在GridP...
分类:
微信 时间:
2015-08-09 17:15:41
阅读次数:
2714
Description
You have N integers, A1, A2, ... ,
AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is...
分类:
其他好文 时间:
2015-08-09 17:14:34
阅读次数:
97
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2015-08-09 16:53:52
阅读次数:
154
Number of 1 Bits leetcode解题报告...
分类:
其他好文 时间:
2015-08-09 14:14:19
阅读次数:
126
一个数字是Balanced Numbers,当且仅当组成这个数字的数,奇数出现偶数次,偶数出现奇数次一下子就相到了三进制状压,数组开小了,一直wa,都不报re,使用记忆化搜索,dp[i][s] 表示长度为i,状态为s,时,满足条件的balance number的个数#include #include...
分类:
其他好文 时间:
2015-08-09 10:46:00
阅读次数:
93