Cod sursa(job #2530938)
Utilizator | Data | 25 ianuarie 2020 14:41:49 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int t,n;
int main()
{
fin >> t;
for(;t;t--)
{
fin >> n;
int r=0,x;
for(;n;n--)
fin >> x, r^=x;
if(r)
fout << "DA\n";
else
fout << "NU\n";
}
return 0;
}