Cod sursa(job #1548664)
Utilizator | Data | 11 decembrie 2015 12:15:44 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <cstdio>
using namespace std;
int main() {
freopen("nim.in", "r", stdin);
freopen("nim.out", "w", stdout);
int t, n, aux, old;
scanf("%d\n", &t);
while (t-- > 0) {
scanf("%d\n", &n);
old = 0;
while (n-- > 0) {
scanf("%d", &aux);
old ^= aux;
}
if (old) {
printf("DA\n");
} else {
printf("NU\n");
}
}
return 0;
}