摘要: 以下来自:http://www.cnblogs.com/krisdy/archive/2009/04/12/1434013.html1、必然会出现循环这是基于下面事实:1. R(n+2)=F(n+2) mod P=(F(n+1)+F(n)) mod P=(F(n+1) mod p +F(n) modp) mod p2. 斐波那契数列的最大公约数定理:gcd(F(m),F(n))=F(gcd(m,n... 阅读全文
posted @ 2013-03-01 08:03 码代码的猿猿 阅读(509) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std; int c[1001]; string color; string real_color[1001];int main(){ int n; cin>>n;while(n!=0){ int real_n=0; int max=0; int pos=-1; m... 阅读全文
posted @ 2013-03-01 05:57 码代码的猿猿 阅读(78) 评论(0) 推荐(0) 编辑