摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1811不过我测试数据 第三组没过 估计是 取余这里错了代码还是 贴一下吧。。 到时候 再 贴ac代码#include<iostream>using namespace std;struct node{int p[100][100];};node a,b,c,f;int mod;node cheng(node a,node b,int n, 阅读全文
posted @ 2013-05-30 20:43 galaxy77 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2157题意:求从点s 走k步 到点 t 的方法种数#include<iostream>#include<string.h>using namespace std;struct node{int p[22][22];};node a,b;int n;node cheng(node a,node b){ node c; int i,j,k; for(i=0;i<n;i++) for(j=0;j<n;j++) { c.p[i][j]=0; ... 阅读全文
posted @ 2013-05-30 20:33 galaxy77 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;struct node{int p[100][100];};node a,b;int num,n,qq;node cheng(node a,node b){ node c; int j,i,w,k; for(i=0;i<num;i++) for(j=0;j<num;j++) { int w=0; //c.p[i][j]=0; for(k=0;k<num;k++) w+=(a.p[i][k]*b.p[k][j])%qq; c.p[i][j]=w%qq; } return c;}void so 阅读全文
posted @ 2013-05-30 20:28 galaxy77 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<math.h>using namespace std;double a[100][100];int n;void gaosi(){ int i,j,k,r; for(i=0;i<n;i++) { r=i; for(j=i+1;j<n;j++) if(fabs(a[j][i])>fabs(a[r][i])) r=i; for(j=i;j<=n;j++) { double w; w=a[i][j];a[i][j]=a[r][j];a[r][j]=w; } for(j=i+1;j<=n;j++ 阅读全文
posted @ 2013-05-30 20:26 galaxy77 阅读(758) 评论(0) 推荐(0) 编辑