Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:路过的帮忙看看,为什么wa?

Posted by Chris001 at 2006-05-13 20:03:22 on Problem 2260
In Reply To:路过的帮忙看看,为什么wa? Posted by:yulai251752 at 2006-03-31 22:42:48
> #include<stdio.h>
> int main()
> {
> 	int i,j,n,t,k,p,sum1,sum2,x,a[100][100],b[100],c[100];
> 	while(1)
> 	{
> 		t=0;
> 		x=0;
> 	
> 		scanf("%d",&n);
> 		if(n==0)break;
> 		for(i=0;i<n;i++)
> 		{
> 			for(j=0;j<n;j++)
> 		  {
> 			scanf("%d",&a[i][j]);
> 		  }
> 		}
> 		for(t=0,p=0;p<n;p++)
> 		{
> 		  for(sum1=0,k=0;k<n;k++)
> 		  {
> 			sum1+=a[p][k];
> 		  }
> 		  if(sum1%2!=0)b[t++]=p;
> 		}
> 			
> 			for(x=0,p=0;p<n;p++)
> 		{
> 		for(sum2=0,k=0;k<n;k++)
> 		{
> 			sum2+=a[k][p];
> 		}
> 		if(sum2%2!=0)c[x++]=p;
> 			}	
> 			
> 		if(t==0&&x==0)	printf("OK\n");
> 		else if(t==1&&x==1) printf("Change bit (%d,%d)\n",b[t-1]+1,c[x-1]+1);
> 		else printf("Corrupt\n");
> 	}
> 	return 0;
> }		

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator