Mai intai trebuie sa te autentifici.
Cod sursa(job #2810302)
| Utilizator | Data | 28 noiembrie 2021 23:37:41 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
inline void Open(const string Name) {
#ifndef ONLINE_JUDGE
(void)!freopen((Name + ".in").c_str(), "r", stdin);
(void)!freopen((Name + ".out").c_str(), "w", stdout);
#endif
}
int T;
void solve() {
int N, x, sumxor = 0;
cin >> N;
for(int i = 1;i <= N;i++)
cin >> x, sumxor ^= x;
if(sumxor) {
cout << "DA\n";
return;
}
cout << "NU\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
Open("nim");
cin >> T;
while(T--) {
solve();
}
return 0;
}