题目链接题意 : 用矩阵相乘求斐波那契数的后四位。思路 :基本上纯矩阵快速幂。 1 //3070 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 struct Matrix 9 {10 int v[2][2...
分类:
其他好文 时间:
2014-06-28 17:48:14
阅读次数:
214
递归应用编辑递归算法一般用于解决三类问题:(1)数据的定义是按递归定义的。(Fibonacci函数)(2)问题解法按递归算法实现。(回溯)(3)数据的结构形式是按递归定义的。(树的遍历,图的搜索)递归的缺点:递归算法解题相对常用的算法如普通循环等,运行效率较低。因此,应该尽量避免使用递归,除非没有更...
分类:
其他好文 时间:
2014-06-28 16:13:46
阅读次数:
576
题目链接:点击打开链接
题意:
给定一个数n
问把这个数拆成多个不相同的fibonacci数
有多少种拆法
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll __int64
#define N 90
ll n ,m...
分类:
其他好文 时间:
2014-06-25 08:44:51
阅读次数:
177
题意:
给定n,AA
下面n个数m1,m2···mn
则有n条方程
res % m1 = m1-AA
res % m2 = m2-AA
问res的最小值
直接上剩余定理,嘿嘿
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll ...
分类:
其他好文 时间:
2014-06-24 22:32:50
阅读次数:
315
I won't forget Ki-kun until the day I forget Ki-kun — Mafuyu Shiina , Life is never too short to try again! — Kurimu Sakurano It's not that the world....
分类:
其他好文 时间:
2014-06-24 15:16:16
阅读次数:
210
Revenge of Fibonacci
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 204800/204800 K (Java/Others)
Total Submission(s): 1944 Accepted Submission(s): 446
Problem Description
The wel...
分类:
其他好文 时间:
2014-06-22 18:53:52
阅读次数:
171
XStream is a simple library to serialize objects to XML and back again.FeaturesEase of use.A high level facade is supplied that simplifies common use ...
分类:
Web程序 时间:
2014-06-22 13:31:51
阅读次数:
285
CCache is a compiler cache for C/C++. It speeds up recompilation by caching the result of previous compilations and detecting
when the same compilation is being done again. We can use this tool to s...
分类:
移动开发 时间:
2014-06-21 21:13:40
阅读次数:
318
Problem Description
give you a string, please output the result of the following function mod 1000000007
n is the length of the string
f() is the function of fibonacci, f(0) = 0, f(1) = 1...
a...
分类:
其他好文 时间:
2014-06-14 11:45:49
阅读次数:
243
递归的正式定义:
在数学和计算机科学中,递归指由一种(或多种)简单的基本情况定义的一类对象或方法,并规定其他所有情况都能被还原为其基本情况。
例如,下列为某人祖先的递归定义:
某人的双亲是他的祖先(基本情况)。
某人祖先的双亲同样是某人的祖先(递归步骤)...
分类:
其他好文 时间:
2014-06-14 10:22:52
阅读次数:
162