Cod sursa(job #3261407)

Utilizator ax_dogaruDogaru Alexandru ax_dogaru Data 5 decembrie 2024 19:18:47
Problema Jocul NIM Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("nim.in");
ofstream fout("nim.out");

int main()
{
    int t, n, x, sol=0;
    fin >> t;
    while(t--) {
        fin >> n;
        for(int i=0; i<n; i++) {
            fin >> x;
            sol=(sol^x);
        }
        if(sol==0) {
            fout << "NU\n";
        } else {
            fout << "DA\n";
        }
    }
    return 0;
}