见这里:http://blog.csdn.net/ACdreamers/article/details/25616461 有详细的分析推理只找出了循环节的上限,设 f[n] = (af[n - 1] + b[n - 2])%P,设序列a ={ f[1], f[2] }, 考虑t项后, b ={ f[...
分类:
其他好文 时间:
2014-08-19 03:16:37
阅读次数:
226
Fibonacci: 0, 1, 1, 2, 3, 5, 8, 13, .... F[0] = 0;1: gcd(Fn, Fm) = F[gcd(n, m)]; 当n - m = 1 或 2时满足,可用数学归纳法证明;2: 特征方程为 x^2 = x + 1, 类Fibonacci数列的特征方程为:...
分类:
其他好文 时间:
2014-08-19 00:45:13
阅读次数:
350
Summation of sequence of integersis always a common problem in Computer Science. Rather than computing blindly,some intelligent techniques make the task simpler. Here you have to find thesummation of ...
分类:
其他好文 时间:
2014-08-18 22:10:23
阅读次数:
314
dijkstra算法,最简单的实现需要$O(|V|^2)$。用binary heap实现,可以优化到O((|V|+|E|)lg|V|),如果用fibonacci heap的话,可以优化到O(|E|+|V|lg|V|)。如果图是密集图的话,那这个优化效果也不好,接近$O(|V|^2)$。For any...
分类:
其他好文 时间:
2014-08-18 21:51:52
阅读次数:
396
hdu4786:http://acm.hdu.edu.cn/showproblem.php?pid=4786题意:给你一个无向图,然后其中有的边是白色的有的边是黑色的。然后问你是否存在一棵生成树,在这课生成树上白色边的数量是一个斐波那契数。题解:完全没有那样的思想,一道现场水题,就是不会啊,实力太弱...
分类:
其他好文 时间:
2014-08-18 17:54:12
阅读次数:
162
Description
Again Prime? No time.
Input: standard input
Output: standard output
Time Limit: 1 second
The problem statement is very easy. Given a number
n you have to determine the largest p...
分类:
其他好文 时间:
2014-08-18 14:34:52
阅读次数:
193
题目链接:点击打开链接
1038 - Race to 1 Again
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
Rimi learned a new thing about integers, whic...
分类:
其他好文 时间:
2014-08-18 01:35:13
阅读次数:
283
Colossal Fibonacci Numbers!
The i'th Fibonacci number f (i) is recursively defined in the following way:
f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0
Your task is to comput...
分类:
其他好文 时间:
2014-08-15 17:55:09
阅读次数:
241
[问题描述]已知m,n为整数,且满足下列两个条件: ①m,n∈{1,2,…,k},即1k; writeln(m,' ',n);end;又是一个令人惬意的短代码,这道题重要的不是代码,而是要转化代数式以及联想到Fibonacci数列。看了看标准程序,和我的也是大同小异,就不再给出。
分类:
其他好文 时间:
2014-08-15 17:41:09
阅读次数:
494
题意 某大参加ACM竞赛回来落下很多作业 每个作业都有最后期限 没在最后期限之内做完期末就要扣掉对应的分 求最少扣多少分
把所有作业按扣分大小从大到小排序 然后就贪阿 能完成前面的就完成前面的 实在不能的就扣分吧~
#include
#include
#include
using namespace std;
const int N = 1005;
int dli[N], r...
分类:
其他好文 时间:
2014-08-14 20:35:19
阅读次数:
174