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:那事实证明你造的数据不够bt

Posted by Thank_you at 2007-08-08 23:32:41 on Problem 2260
In 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:
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