Cod sursa(job #3225274)
Utilizator | Data | 17 aprilie 2024 11:23:08 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("nim.in");
ofstream fout ("nim.out");
int main()
{
fin.tie(0); fin.sync_with_stdio(false);
int t; fin>>t;
while (t--) {
int n, sol, x;
fin>>n;
fin>>sol;
for (int i=2; i<=n; i++) {
fin>>x;
sol=sol^x;
}
if (sol==0) fout<<"NU\n";
else fout<<"DA\n";
}
return 0;
}