Cod sursa(job #2369381)
| Utilizator | Data | 5 martie 2019 22:50:09 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <iostream>
#include <bitset>
using namespace std;
ifstream fin ("nim.in");
ofstream fout ("nim.out");
typedef long long ll;
int n, t;
void Solve ()
{
fin >> t;
while (t--)
{
int xors = 0;
fin >> n;
for (int i = 1; i <= n; i++)
{
int x;
fin >> x;
xors ^= x;
}
if (!xors)
fout << "NU\n";
else fout << "DA\n";
}
fout.close();
}
int main()
{
Solve();
return 0;
}
