Cod sursa(job #912435)
Utilizator | Data | 12 martie 2013 13:46:39 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std ;
int n ;
int x, sumaxor ;
int tst ;
int main()
{
freopen("nim.in", "r", stdin);
freopen("nim.out", "w", stdout);
scanf("%d", &tst);
while( tst-- )
{
scanf("%d", &n);
sumaxor = 0 ;
for(int i = 1; i <= n; ++i)
{
scanf("%d", &x);
sumaxor ^= x ;
}
if( sumaxor )
puts("DA");
else
puts("NU");
}
return 0 ;
}