码迷,mamicode.com
首页 >  
搜索关键字:consecutive numbers    ( 8082个结果
Longest Consecutive Sequence
[leetcode]Given an unsorted array of integers, find the length of the longest consecutive elements sequence....
分类:其他好文   时间:2014-09-19 12:09:45    阅读次数:167
c++笔试题两道,求解其中一道
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
Sum Root to Leaf Numbers
[leetcode]Sum Root to Leaf Numbers...
分类:其他好文   时间:2014-09-19 12:05:04    阅读次数:145
Combinations
[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【筛法求素数】【枚举】
POJ2739_Sum of Consecutive Prime Numbers【筛法求素数】【枚举】...
分类:其他好文   时间:2014-09-18 23:51:14    阅读次数:237
【POJ2196】Specialized Four-Digit Numbers(暴力打表)
一道水题,只要会复制粘贴就好! 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
poj3252(Round Numbers)
题目地址:Round Numbers题目大意: “Round Numbers” 是一个十进制的数转化为二进制,如果在二进制中 “0”的个数不小于“1”的个数,就称为“Round Numbers” 。本题求出n到m区间(闭区间)的“Round Numbers” 有多少个。解题思路: 排列组合的公式.....
分类:其他好文   时间:2014-09-18 22:04:04    阅读次数:145
ctrip的两道笔试题
第一个问题可以抽象为这样:给定一个数组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
UVA 763 Fibinary Numbers
题意讲某个二进制按照规则每一位对应斐波那契数生成新的数字,然后2个数字求和。再求由该规则生成的二进制串。并且要求尽量用更大项的fib数(题目提示不能由连续的1就是2个连续的1(11)不如100更优)用大数处理出100项fib。然后模拟交替置位位0或者1,输出#include #include #in...
分类:其他好文   时间:2014-09-18 14:31:53    阅读次数:199
【LeetCode】Triangle 解题报告
【题目】 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!