Cod sursa(job #3162443)
Utilizator | Data | 29 octombrie 2023 11:43:55 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.32 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int n, t, x, sol;
int main(){
fin>>n;
for(int i=1; i<=n; i++){
fin>>t;
for(int j=1; j<=t; j++){
fin>>x;
sol ^= x;
}
fout<<(sol?"DA\n":"NU\n");
}
}