"Bzoj" "2940" "POI2000" stripe

Source: Internet
Author: User

Game theory

At first I wanted to be a s-nim ... Later found not the same = = the stone is to be taken, but the stripe is like crosses and crosses, it can be spread to the middle, left and right to leave the gap but the opponent has nowhere to put ...

So that is the two-way combination of the method of the ~

  

1 /**************************************************************2 problem:29403 User:tunix4 language:c++5 result:accepted6 time:60 Ms7 memory:1276 KB8 ****************************************************************/9  Ten //Bzoj 2940 One#include <cstdio> A#include <cstring> -#include <iostream> - #defineF (i,j,n) for (int i=j;i<=n;++i) the intGetint () { -     intv=0, sign=1;CharCh=GetChar (); -      while(!isdigit (CH)) {if(ch=='-') sign=-1; Ch=GetChar ();} -      while(IsDigit (CH)) {v=v*Ten+ch-'0'; Ch=GetChar ();} +     returnv*Sign ; - } + Const intn=1010, inf=~0u>>2; A   at inta[4],sg[n]; - BOOLMark[n]; - intMain () { -F (I,1,3) a[i]=getint (); -     intn=getint (); -F (I,1, +){ inmemset (Mark,0,sizeofmark); -F (J,1,3) to              for(intk=0; k<=i-a[j]-k;++k) +mark[sg[k]^sg[i-a[j]-k]]=1; -F (J,0Iif(!mark[j]) {sg[i]=j; Break;} the     } *F (I,1, N) { $printf"%d", Sg[getint ()]?1:2);Panax Notoginseng         if(i!=n) printf ("\ n"); -     } the     return 0; +}
View Code

"Bzoj" "2940" "POI2000" stripe

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.