Cod sursa(job #3162445)
Utilizator | Data | 29 octombrie 2023 11:45:07 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.34 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>0?"DA\n":"NU\n");
sol = 0;
}
}