[leetcode]Given an unsorted array of integers, find the length of the longest consecutive elements sequence....
分类:
其他好文 时间:
2014-09-19 12:09:45
阅读次数:
167
1.Implement a functionthat prints the numbers from 1 to 100.But for multiples of three(3) print “Zif”insteadof the number and for the multiples of five(5) print “Nab”. For numbers whichare multiples...
分类:
编程语言 时间:
2014-09-19 12:06:25
阅读次数:
198
[leetcode]Sum Root to Leaf Numbers...
分类:
其他好文 时间:
2014-09-19 12:05:04
阅读次数:
145
[leetcode]Given two integers n and k, return all possible combinations of k numbers out of 1 ... n....
分类:
其他好文 时间:
2014-09-19 10:07:55
阅读次数:
209
POJ2739_Sum of Consecutive Prime Numbers【筛法求素数】【枚举】...
分类:
其他好文 时间:
2014-09-18 23:51:14
阅读次数:
237
一道水题,只要会复制粘贴就好! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 #define P...
分类:
其他好文 时间:
2014-09-18 23:42:34
阅读次数:
176
题目地址:Round Numbers题目大意: “Round Numbers” 是一个十进制的数转化为二进制,如果在二进制中 “0”的个数不小于“1”的个数,就称为“Round Numbers” 。本题求出n到m区间(闭区间)的“Round Numbers” 有多少个。解题思路: 排列组合的公式.....
分类:
其他好文 时间:
2014-09-18 22:04:04
阅读次数:
145
第一个问题可以抽象为这样:给定一个数组A,和一个数t,用数组里的一些数求和得到t,数组里的数可以重复使用,写一个算法,使得使用A中最少的数来表示t。比如:[2,4,6,9],18==>[9,9]dfs问题//numbers要从大到小,一个sort搞定,result存放结果bool dfs(vecto...
分类:
其他好文 时间:
2014-09-18 22:02:24
阅读次数:
162
题意讲某个二进制按照规则每一位对应斐波那契数生成新的数字,然后2个数字求和。再求由该规则生成的二进制串。并且要求尽量用更大项的fib数(题目提示不能由连续的1就是2个连续的1(11)不如100更优)用大数处理出100项fib。然后模拟交替置位位0或者1,输出#include #include #in...
分类:
其他好文 时间:
2014-09-18 14:31:53
阅读次数:
199
【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[...
分类:
其他好文 时间:
2014-09-18 11:29:23
阅读次数:
201