Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible o...
分类:
其他好文 时间:
2014-08-08 02:06:05
阅读次数:
207
题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique....
分类:
编程语言 时间:
2014-08-08 01:54:55
阅读次数:
292
题意 所有可以表示为4*k+1(k>=0)的数都称为“H数” 而在所有“H数”中只能被1和自身整除的H数称为“H素数“ 能表示成两个”H素数“积的数又称为”Semi-prime H数“
输入n 求1到n之间有多少个”Semi-prime H数“;
方法 先打个H素数表 再用H素数表中的数依次相乘 得到的数都标记 再用一个数组保存每个数以内的标记数 输入n后直接读数组就行了...
分类:
其他好文 时间:
2014-08-07 23:11:35
阅读次数:
265
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;{ //string就是此时输入的那个字符tex....
分类:
其他好文 时间:
2014-08-07 21:58:50
阅读次数:
198
1.MVC验证 1.1.验证方式 引入命名空间 using System.ComponentModel.DataAnnotations;定义验证规则:Model属性添加内置验证特性,介绍用的最多的其中的四个:[Required], [StringLength], [Range], 和 [Regula...
分类:
Web程序 时间:
2014-08-07 21:57:30
阅读次数:
369
该题可以用DFS解决,在DFS时记录path,当到达leaf时将path所表示的数加到sum上。 1 class Solution { 2 public: 3 int sumNumbers(TreeNode *root) { 4 vector path; 5 ...
分类:
其他好文 时间:
2014-08-07 18:50:40
阅读次数:
197
题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a singl...
分类:
其他好文 时间:
2014-08-07 12:51:00
阅读次数:
188
1. python的generator是啥?
参见
https://wiki.python.org/moin/Generators
http://linuxgazette.net/100/pramode.html
就是一个能够当做iterator使用的function。例如如下常用的玩意
for i in range(10):
print i
2. 这东西难不难实现?
如果不允...
分类:
其他好文 时间:
2014-08-07 09:48:39
阅读次数:
255
题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message....
分类:
编程语言 时间:
2014-08-07 05:11:09
阅读次数:
247
G -Self Numbers(2.2.1)Time Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionIn 1949 the Indian mathematician D.R. K...
分类:
其他好文 时间:
2014-08-07 00:27:37
阅读次数:
249