Cod sursa(job #2599915)
Utilizator | Data | 11 aprilie 2020 20:10:53 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int t, n, sol;
int main()
{
fin >> t;
while(t--){
fin >> n; sol = 0;
while(n--){
int x;
fin >> x;
sol ^= x;
}
fout << (sol ? "DA\n" : "NU\n");
}
return 0;
}