Cod sursa(job #2787096)
Utilizator | Data | 22 octombrie 2021 14:56:13 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main()
{
ios_base::sync_with_stdio(false);
int t, n, r, x;
fin >> t;
while(t--)
{
fin >> n;
r = 0;
while(n--) fin >> x, r ^= x;
if(r == 0) fout << "NU" << '\n';
else fout << "DA" << '\n';
}
return 0;
}