hiho week 46 register

Ended

Participants:418

Verdict:Accepted
Score:100 / 100
Submitted:2015-05-23 14:09:14

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<cstdio>
using namespace std;
int n,a,sg[20000],ans;
int main(){
    sg[0]=0;
    for(int i=1;i<20001;++i){
        sg[i]=i;
        if(i%4==3)++sg[i];
        if(i%4==0)--sg[i];
    }
    scanf("%d",&n);
    for(int i=0;i<n;++i){
        scanf("%d",&a);
        ans^=sg[a];
    }
    if(ans)printf("Alice\n");
    else   printf("Bob\n");
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX