Cod sursa(job #2570345)
Utilizator | Data | 4 martie 2020 16:17:09 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
using namespace std;
void Read ()
{
ifstream fin ("nim.in");
ofstream fout ("nim.out");
int tests, n;
fin >> tests;
while (tests--)
{
int xorsum = 0, x;
fin >> n;
while (n--)
{
fin >> x;
xorsum ^= x;
}
if (xorsum) fout << "DA\n";
else fout << "NU\n";
}
}
int main()
{
Read();
return 0;
}