Cod sursa(job #3349928)
| Utilizator | Data | 3 aprilie 2026 16:56:47 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.34 kb |
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main(){
int t, n, x, s;
fin >> t;
while(t--){
fin >> n;
s = 0;
while(n--){
fin >> x; s ^= x;
}
fout << (s == 0? "NU\n": "DA\n");
}
fin.close();
fout.close();
return 0;
}