原题地址:https://oj.leetcode.com/problems/longest-consecutive-sequence/题意:Given
an unsorted array of integers, find the length of the longest consecutive ...
分类:
编程语言 时间:
2014-06-06 23:13:20
阅读次数:
324
原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/题意:Say
you have an array for which theithelement is the price of a given stoc...
分类:
编程语言 时间:
2014-06-06 20:04:46
阅读次数:
400
The count-and-say sequence is the sequence of
integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one
1"or11.11is read off as"tw...
分类:
其他好文 时间:
2014-06-06 19:53:31
阅读次数:
203
Problem DescriptionGiven a circle sequence
A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is
A[n] , and the right neighbou...
分类:
其他好文 时间:
2014-06-06 14:52:21
阅读次数:
247
Swift is a new programming language for iOS and OS
X apps that builds on the best of C and Objective-C, without the constraints of
C compatibility.Swi...
分类:
其他好文 时间:
2014-06-06 08:28:23
阅读次数:
187
http://poj.org/problem?id=1699题意:给你n个长度为L的序列,求包含这几个序列的最短长度。先预处理每两个序列之间的关系,然后dfs枚举就行。
1 #include 2 #include 3 #include 4 #define maxn 500 5 using na...
分类:
其他好文 时间:
2014-06-04 16:34:14
阅读次数:
255
title:
The following iterative sequence is defined for the set of positive integers:
n
n/2 (n is even)
n 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the followi...
分类:
其他好文 时间:
2014-06-04 13:56:33
阅读次数:
254
Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds mode...
分类:
其他好文 时间:
2014-06-04 13:19:23
阅读次数:
282
题意:求集合{1,2,3...n}的第m个排列子集合。集合的大小按字典树排。
例两个元素的排列子集合按字典树排列是:{1},{1,2},{2},{2,1};
解法:一个一个元素来确定,每次把剩余的元素按大小顺序排列在num中,然后根据排列组合原理直接计算下一个位置的元素的大小,直到排列数为0停止;
代码:/*************************...
分类:
其他好文 时间:
2014-06-02 15:09:09
阅读次数:
280
Best Time to Buy and Sell Stock IISay you have
an array for which theithelement is the price of a given stock on dayi.Design an
algorithm to find the ...
分类:
其他好文 时间:
2014-06-02 15:01:53
阅读次数:
305