HDU 3032:
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
#define LL Long Long
int main ()
{
int t;
scanf ("%d", &t);
while (t--)
{
int n,i,j,k;
scanf ("%d", &n);
int ans=0;
while (n--)
{
scanf ("%d", &k);
j=k%4;
if (j==3) k++;
else if (j==0) k--;
ans^=k;
}
if (ans)
printf ("alice\n");
else
printf ("bob\n");
}
}
HDU 1525:
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
#define LL Long long
int p[1000];
int main ()
{
int n,m,t;
while (scanf ("%d%d", &n,&m), n+m)
{
if (n<m) swap (n,m);
int cnt=0;
while (m)
{
p[cnt]=n/m;
t=m;
m=n%m;
n=t;
cnt++;
}
int F;
if (cnt==0)
f=0;
else if (cnt==1)
{
f=1;
}
else
{
int sum=0;
for (int i=0;i<cnt-1;i++)
{
if (p[i]==1)
sum++;
else break
;
}
if (sum%2==1)
f=0;
else
f=1;
}
if (f==1)
printf ("Stan wins\n");
else
printf ("Ollie wins\n");
}
}