Cod sursa(job #2117122)
Utilizator | Data | 28 ianuarie 2018 16:18:05 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("nim.in");
ofstream g("nim.out");
int main(){
int t;
f >> t;
while(t--){
int n;
f >> n;
int xorsum = 0;
while(n--){
int x;
f >> x;
xorsum ^= x;
}
g << (xorsum == 0? "NU\n" : "DA\n");
}
return 0;
}