Cod sursa(job #687201)
Utilizator | Data | 22 februarie 2012 10:34:35 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.3 kb |
#include<stdio.h>
int main()
{
int N, x, now, NIM;
freopen("nim.in", "r", stdin);
freopen("nim.out", "w", stdout);
scanf("%d", &N);
while(N --)
{
scanf("%d", &x);
NIM = 0;
while(x --)
{
scanf("%d", &now);
NIM = NIM ^ now;
}
printf("%s\n", NIM > 0 ? "DA" : "NU");
}
return 0;
}