Cod sursa(job #2457007)
Utilizator | Data | 16 septembrie 2019 11:27:50 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int N;
long long xorSum;
int main()
{
int T;
fin >> T;
for(int i = 1; i <= T; i++)
{
fin >> N;
xorSum = 0;
for(int j = 1; j <= N; j++)
{
long long x;
fin >> x;
xorSum ^= x;
}
if(xorSum > 0)
fout << "DA\n";
else
fout << "NU\n";
}
return 0;
}