Cod sursa(job #3349808)
| Utilizator | Data | 2 aprilie 2026 16:24:08 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main()
{
int t;
fin >> t;
while(t--)
{
int n;
fin >> n;
long long x, xr = 0;
for(int i = 0; i < n; i++)
{
fin >> x;
xr ^= x;
}
if(xr == 0)
{
fout << "NU\n";
}
else
{
fout << "DA\n";
}
}
return 0;
}
