Cod sursa(job #3226019)
Utilizator | Data | 19 aprilie 2024 17:00:56 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
#define nl '\n'
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main()
{
int T, N, x, S;
fin >> T;
while (T--)
{
fin >> N;
S = 0;
while (N--)
{
fin >> x;
S^=x;
}
fout << (S != 0 ? "DA\n" : "NU\n");
}
fin.close();
fout.close();
return 0;
}