Cod sursa(job #2673942)
Utilizator | Data | 18 noiembrie 2020 11:26:10 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.26 kb |
#include <fstream>
int main() {
std::ifstream fin("nim.in");
std::ofstream fout("nim.out");
int t, n, c;
fin >> t;
while (t--) {
fin >> n;
int x = 0;
while (n--) {
fin >> c;
x ^= c;
}
fout << ((x == 0) ? "NU" : "DA") << "\n";
}
}