hiho week 46 register

Ended

Participants:418

Verdict:Accepted
Score:100 / 100
Submitted:2015-05-18 22:52:10

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 20000 + 10;
int a[MAXN];
int main() {
    int p, n, t;
    while( ~scanf( "%d", &n ) ) {
        p = 0;
        while( n-- ) {
            scanf( "%d", &t );
            if( t % 4 == 1 || t % 4 == 2 ) p ^= t;
            else if( t % 4 == 3 ) p ^= ( t + 1 );
            else p ^= ( t - 1 );
        }
        if( p ) printf( "Alice\n" );
        else printf( "Bob\n" );
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX