#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int n,i,j,flagr,flagc,sumr,sumc;
int *p,*q;
int a[100][100];
while(scanf("%d",&n)&&n){
flagr = 0;
flagc = 0;
p = (int *)malloc(n*sizeof(int));
q = (int *)malloc(n*sizeof(int));
memset(p,0,n*sizeof(int));
memset(q,0,n*sizeof(int));
for(i = 0;i<n;i++){
for(j = 0;j<n;j++)
{
scanf("%d",&a[i][j]);
p[i] += a[i][j];
}
}
for(j = 0;j<n;j++)
for(i = 0;i<n;i++)
q[j] += a[i][j];
sumr = 0;
sumc = 0;
for(i = 0;i<n;i++)
{
if(p[i]%2) {
flagr++;
sumr = i;
}
if(q[i]%2){
flagc++;
sumc = i;
}
}
if(flagr == 0&&flagc==0) printf("OK\n");
else if(flagr == 1&&flagc == 1) printf("Change bit (%d,%d)\n",sumr+1,sumc+1);
else printf("Corrupt\n");
}
return 0;
}
zoj 1949 Error Correction
最新推荐文章于 2019-12-12 15:22:40 发布