斐波那契数列。。。利用斐波那契数列的循环:因为结果%n,所以最多有n^2个数后会出现循环。预处理,不能直接用f[maxn][maxn^2]来保存,数组太大。。。所以用vector来保存斐波那契数列%n 的值。 1 #include 2 #include 3 #include 4 #includ...
分类:
其他好文 时间:
2014-08-01 19:04:12
阅读次数:
173
HDU 2674 N!Again (数论-水题)
题目大意:
求N!%2009的最大值,n最大10^9;
解题思路:
我靠,乍一看数据量挺大的,几秒后反应过来,n>=2009后还要计算个毛线。...
分类:
其他好文 时间:
2014-08-01 16:15:41
阅读次数:
307
注意n=1的情况#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typed...
分类:
其他好文 时间:
2014-08-01 15:31:01
阅读次数:
260
/*
大菲波数
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 11168 Accepted Submission(s): 3782
Problem Description
Fibonacci数列,定义如下:
f(1...
分类:
其他好文 时间:
2014-07-31 20:58:17
阅读次数:
181
Description
Recall the definition of the Fibonacci numbers:
f1 := 1
f2 := 2
fn := fn-1 + fn-2 (n>=3)
Given two numbers a and b, calculate how many Fibonacci numbers are in the range...
分类:
其他好文 时间:
2014-07-31 17:11:07
阅读次数:
325
(早上,肯德基,AGAIN,加油,兄弟)
尹老师在书里说,项目经理两头受气,要面对下面的兄弟,面对领导,面对客户,你代表了很多人,就是没有代表自己的时候。
这话让我想起来郑智化的一首歌,“戏子啊戏子,忘了自己的名字”,没错,任何时候,别人提起你这个人,都是某某公司的XX项目经理,你真没有自己的名字,戏子的一切目的是为了成就一部戏,而项目经理的一切目的,是为了成就一个项目。为了项...
分类:
其他好文 时间:
2014-07-31 13:33:06
阅读次数:
187
大菲波数
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 11143 Accepted Submission(s): 3772
Problem Description
Fibonacci数列,定义如下:
f(1)=...
分类:
其他好文 时间:
2014-07-31 09:56:56
阅读次数:
228
假如F[1] = a, F[2] = B, F[n] = F[n - 1] + F[n - 2]。写成矩阵表示形式可以很快发现F[n] = f[n - 1] * b + f[n - 2] * a。 f[n] 是斐波那契数列也就是我们如果知道一段区间的前两个数增加了多少,可以很快计算出这段区间的第k个...
分类:
其他好文 时间:
2014-07-31 09:47:46
阅读次数:
286
shell的种类: sh ?- Bourne shell csh or tcsh - C shell korn - Korn shell bash - GNU Bourne-Again shell 1.最简单的列子 例子 #!/bin/bash ? #?This?is?a?very?simple?example?echo?Hello?World e...
分类:
其他好文 时间:
2014-07-31 00:13:45
阅读次数:
454
Description
The Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f0 and f1 which are respect...
分类:
其他好文 时间:
2014-07-31 00:08:05
阅读次数:
281