Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:那事实证明你造的数据不够btIn Reply To:为什么wa?我自己造的变态数据都过了啊...各种特殊情况都考虑到了啊..还有疏漏? Posted by:dong930 at 2007-08-08 16:41:07 > #include<stdio.h> > #include<string.h> > main() > { > int a[200][200]; > int r[20],c[20],i,j,flagr,flagc; > int n; > while(scanf("%d",&n) && n) > { > int lr,lc; > memset(r,0,sizeof r); > memset(c,0,sizeof c); > flagr=flagc=0; > for(i=1;i<=n;i++) > for(j=1;j<=n;j++) > { > scanf("%d",&a[i][j]); > r[i]+=a[i][j]; > c[j]+=a[i][j]; > } > for(i=1;i<=n;i++) > { > if(r[i]%2==1){flagr++;lr=i;} > if(c[i]%2==1){flagc++;lc=i;} > } > if(flagr>1 || flagc>1 || (flagr==1 && flagc==0) || (flagc==1 && flagr==0)) > {printf("Corrupt\n"); continue;} > if(flagc==0 && flagr==0) > {printf("OK\n");continue;} > printf("Change bit (%d,%d)\n",lr,lc); > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator