HDU - 3389(40/600)

Bob and Alice are playing a new game. There are n boxes which have been numbered from 1 to n. Each box is either empty or contains several cards. Bob and Alice move the cards in turn. In each turn the corresponding player should choose a non-empty box A and choose another box B that B

#include
using namespace std;
#define int long long 
main()
{
    int T;
    cin>>T;
    int u=0;
    while(T--)
    {
        int n;
        cin>>n;
        int zz=0,ww;
        for(int a=1;a<=n;a++)
        {
            scanf("%lld",&ww);
            if(a%6!=2&&a%6!=5&&a%6!=0)continue;
            zz^=ww;
        }
        printf("Case %d: ",++u);
        if(zz)printf("Alice\n");
        else printf("Bob\n");
    }
}

你可能感兴趣的:(ACM练习,博弈)