Cod sursa(job #2764824)
Utilizator | Data | 22 iulie 2021 19:34:22 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <fstream>
using namespace std;
int n, x;
int main()
{
ifstream cin("nim.in");
ofstream cout("nim.out");
int t;
cin >> t;
while (t--)
{
cin >> n;
long long s = 0;
for (int i = 1; i <= n; i++)
{
cin >> x;
s ^= x;
}
bool ura = false;
if (s == 0)
{
ura = true;
}
if (ura) {
cout << "NU\n";
}
else {
cout << "DA\n";
}
}
return 0;
}