Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,...
分类:
其他好文 时间:
2015-05-13 00:42:55
阅读次数:
113
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2015-05-13 00:42:12
阅读次数:
100
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are t...
分类:
其他好文 时间:
2015-05-13 00:37:00
阅读次数:
221
DescriptionLet us define a regular brackets sequence in the following way:Empty sequence is a regular sequence.If S is a regular sequence, then (S) an...
分类:
其他好文 时间:
2015-05-12 22:21:59
阅读次数:
115
Problem Description
A lock you use has a code system to be opened instead of a key. The lock contains a sequence of wheels. Each wheel has the 26 letters of the English alphabet 'a' through 'z', in...
分类:
其他好文 时间:
2015-05-12 18:58:39
阅读次数:
153
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma...
分类:
其他好文 时间:
2015-05-12 18:44:10
阅读次数:
129
So Easy!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2777 Accepted Submission(s): 863
Problem Description
A sequence Sn is...
分类:
其他好文 时间:
2015-05-12 15:50:15
阅读次数:
136
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)...
分类:
其他好文 时间:
2015-05-12 15:18:08
阅读次数:
89
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).InputInput consists of a sequence o...
分类:
其他好文 时间:
2015-05-12 01:37:39
阅读次数:
110
题目:给你Fib数列的前两项,求第n项的后m位的值。
分析:矩阵快速模幂。见本博客的:斐波那契数列
说明:╮(╯▽╰)╭。
#include
#include
#include
#include
#include
#include
using namespace std;
class matrix
{
private:
int data[2][2];
public:
...
分类:
其他好文 时间:
2015-05-11 21:59:24
阅读次数:
141