摘要: 先转一些 http://www.cnblogs.com/frog112111/archive/2013/05/19/3087648.htmlFibonacci数列:F(0)=1 , F(1)=1 , F(n)=F(n-1)+F(n-2)我们以前快速求Fibonacci数列第n项的方法是 构造常系数矩... 阅读全文
posted @ 2014-09-01 21:10 chenjunjie1994 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 必须MARK下:任何时候都要保持清醒头脑,不要被题目绕了。。其实就是求最小公倍数。#include #include #include using namespace std;__int64 v[20];__int64 gcd(__int64 a,__int64 b){ if(b==0) retur... 阅读全文
posted @ 2014-09-01 11:02 chenjunjie1994 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 直接使用中国剩余定理#include #include #include using namespace std;int r=3;int m[4]={0,23,28,33};int a[4]={0};void exgcd(int a,int b,int &d,int &x,int &y){ if(b... 阅读全文
posted @ 2014-09-01 10:25 chenjunjie1994 阅读(134) 评论(0) 推荐(0) 编辑