摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3117只会求后四位的,前四位也是看别人的博客学的。。。。http://blog.csdn.net/xieqinghuang/article/details/7789908View Code 1 #include 2 #include 3 const int m=10000; 4 const double t=(1+sqrt(5.0))/2; 5 using namespace std; 6 int n; 7 int f[40]={0,1,1,2,3,5,8,13,21,34,55}; 8 9 s.. 阅读全文
posted @ 2013-03-01 21:29 ihge2k 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2256感觉矩阵好神奇啊。。。盗张图,看了就知道怎么做了。。。好吧,直接上代码了,问题转化是难点View Code 1 #include 2 const int m=1024; 3 using namespace std; 4 int n; 5 struct Matrix{ 6 int map[2][2]; 7 }; 8 Matrix mat; 9 10 void Initiate(){11 mat.map[0][0]=5;12 mat.map[0][1]=12;13 ... 阅读全文
posted @ 2013-03-01 19:09 ihge2k 阅读(668) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1588比hdu 1757难了好多,看了好多别人的博客才明白。。。哎。。。View Code 1 /* 2 *题意:g(i)=k*i+b,sum(f(g(i)) for 020 using namespace std;21 22 int k,b,n,m;23 struct Matrix {24 __int64 map[2][2];25 };26 Matrix matrix,matk,matb,smat;27 28 //矩阵乘法29 Matrix Mul(Matrix &a,Matrix &am 阅读全文
posted @ 2013-03-01 17:16 ihge2k 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1757盗用一张图:把问题转化为求矩阵的n-9次幂就行了;直接上代码了;View Code 1 #include 2 #include 3 const int N=10; 4 using namespace std; 5 int k,m; 6 struct Matrix{ 7 int map[N][N]; 8 }; 9 10 Matrix matrix;11 12 void Initiate(){13 for(int i=0;i>1);46 return Mul(te... 阅读全文
posted @ 2013-03-01 11:10 ihge2k 阅读(1106) 评论(1) 推荐(1) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1753wa了N次,惭愧啊View Code 1 #include<iostream> 2 #include<string> 3 #include<cstring> 4 const int N=1000; 5 using namespace std; 6 int num[N]; 7 8 int main(){ 9 string str1,str2; 10 while(cin>>str1>>str2){ 11 string s1[2],s2[2 阅读全文
posted @ 2013-03-01 09:17 ihge2k 阅读(217) 评论(0) 推荐(0) 编辑