Bzoj 1923: [Sdoi2010] alien thousand foot worm

Source: Internet
Author: User

1#include <cstdio>2#include <iostream>3 using namespacestd;4 intn,m,a[ the][ the],st=1;5 Charch[6009];6 BOOLGaointA1)7 {8      for(inti=st;i<=a1;i++)9       {Ten         intK; One          for(k=i;k<=a1;k++) A           if(A[k][i]) -              Break; -         if(k==a1+1) the           { -st=i; -             return 0; -           } +          for(intj=1; j<=n+1; j + +) - swap (a[i][j],a[k][j]); +k=A[i][i]; A          for(intj=1; j<=m;j++) at           if(i!=j&&A[j][i]) -             { -k=A[j][i]; -                for(intL=1; l<=n+1; l++) -A[j][l]= (a[j][l]-a[i][l]*k+2)%2; -             } in         if(i==N) -           return 1; to       } + } - intMain () the { *scanf"%d%d",&n,&m); $      for(intI=1; i<=m;i++)Panax Notoginseng       { -scanf"%s", ch+1); the          for(intj=1; j<=n;j++) +a[i][j]=ch[j]-'0'; Ascanf"%d", &a[i][n+1]); the       } +      for(inti=n;i<=m;i++) -       if(Gao (i)) $         { $printf"%d\n", i); -              for(intI=1; i<=n;i++) -               if(a[i][n+1]%2) theprintf"? y7m#\n"); -               ElseWuyiprintf"earth\n"); the             return 0; -         } Wuprintf"cannot determine\n"); -     return 0; About}

According to the problem is the solution equation, so the Gaussian elimination method

Bzoj 1923: [Sdoi2010] alien thousand foot worm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.