Cod sursa(job #3349929)
| Utilizator | Data | 3 aprilie 2026 16:56:55 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.36 kb |
#include <iostream>
#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 ? "DA\n" : "NU\n");
}
return 0;
}
