码迷,mamicode.com
首页 >  
搜索关键字:similar fibonacci    ( 1772个结果
Postgresql - Pattern Matching
There are three separate approaches to pattern matching provided by?PostgreSQL: the traditional?SQL?LIKE?operator, the more recent?SIMILAR TO?operator (added in SQL:1999), and?POSIX-style r...
分类:数据库   时间:2014-09-01 12:44:23    阅读次数:380
UVa - 12617 - How Lader
先上题目:How LaderLader is a game that is played in aregularhexagonal board (all sides equal, all angles are also equal). The game is much similar as pool...
分类:其他好文   时间:2014-08-30 20:24:29    阅读次数:259
HDU3117-Fibonacci Numbers(矩阵快速幂+log)
题目链接 题意:斐波那契数列,当长度大于8时,要输出前四位和后四位 思路:后四位很简单,矩阵快速幂取模,难度在于前四位的求解。  已知斐波那契数列的通项公式:f(n) = (1 / sqrt(5)) * (((1 + sqrt(5)) / 2) ^ n - ((1 + sqrt(5)) / 2) ^ n),当n >= 40时((1 + sqrt(5)) / 2) ^ n近...
分类:其他好文   时间:2014-08-30 15:11:21    阅读次数:288
【POJ】3070 Fibonacci(矩阵乘法)
http://poj.org/problem?id=3070根据本题算矩阵,用快速幂即可。裸题#include #include #include #include #include #include using namespace std;#define rep(i, n) for(int i=0...
分类:其他好文   时间:2014-08-30 09:56:49    阅读次数:204
HDU 1021 Fibonacci Again
题解:找规律……#include int main(){ int n; while(~scanf("%d",&n)){ if((n-2)%4!=0)puts("no"); else puts("yes"); }return 0;}
分类:其他好文   时间:2014-08-30 08:45:09    阅读次数:159
UVA10299- Modular Fibonacci(斐波那契数列+矩阵快速幂)
题目链接 题意:给出n和m,求出f(n) % m, f(x)为斐波那契数列。 思路:因为n挺大的,如果直接利用公式计算很有可能会TLE,所以利用矩阵快速幂求解,|(1, 1), (1, 0)| * |f(n - 1), f(n - 2)| = |f(n), f(n - 1)|,所以求f(n)相当于|f(1), f(0)|乘上n - 1次的|(1, 1), (1, 0)|。 ...
分类:其他好文   时间:2014-08-28 16:57:40    阅读次数:187
Fibonacci 引出的关于递归时间复杂度
FinonacciT(N) = T(N-1) + T(N-2);>= 2T(N-2) = O(2^(N/2))Memorized Dp algorithm//1,1,2,3,5,8.....Memo = {}fib(n): if n in memo, return memo{n} if n<...
分类:其他好文   时间:2014-08-28 04:16:28    阅读次数:183
数论 : 高精度 --- UVa 10183 : How Many Fibs ?
How many Fibs?DescriptionRecall the definition of the Fibonacci numbers:f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calcul...
分类:其他好文   时间:2014-08-27 20:17:48    阅读次数:208
Fibonacci
#include<iostream> usingnamespacestd; intmain() { intpound,p0,p1,days,result; charans; do { cout<<"Pleaseinputthepoundandthedays:\n"; cin>>pound>>days; intn=days/5; if(0==n||1==n) { result=pound; cout<<"Theresultis"<<..
分类:其他好文   时间:2014-08-26 03:12:26    阅读次数:204
杭电1848 Fibonacci again and again(博弈-打表)
Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5093    Accepted Submission(s): 2127 Problem Description 任何一个...
分类:其他好文   时间:2014-08-24 23:55:23    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!