Cod sursa(job #3195785)
Utilizator | Data | 21 ianuarie 2024 18:17:53 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main()
{
int t,n,s,x;
fin >> t;
while(t--){
fin >> n;
s = 0;
while(n--){
fin >> x;
s ^= x;
}
fout << (s ? "DA" : "NU") << "\n";
}
return 0;
}