Pagini recente » Cod sursa (job #2920730) | Lot 2017 Baraj 3 Clasament | Cod sursa (job #1673595) | Cod sursa (job #2428648) | Cod sursa (job #3218047)
#include <iostream>
#include <fstream>
#include <stdint.h>
int main() {
std::ifstream fin("nim.in");
std::ofstream fout("nim.out");
int32_t t;
fin >> t;
for(int32_t i = 0; i != t; ++i) {
int32_t n;
fin >> n;
int32_t sum = 0;
for(int32_t j = 0; j != n; ++j) {
int32_t val;
fin >> val;
sum ^= val;
}
if(sum) {
fout << "DA\n";
} else {
fout << "NU\n";
}
}
fin.close();
fout.close();
return 0;
}