Cod sursa(job #2595959)
Utilizator | Data | 8 aprilie 2020 19:57:03 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.3 kb |
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int t, n, a, x;
int main()
{
fin >> t;
while (t--)
{
x = 0;
fin >> n;
while (n--)
{
fin >> a;
x ^= a;
}
if (x)
fout << "DA\n";
else fout << "NU\n";
}
return 0;
}