Cod sursa(job #2494044)

Utilizator Cezar211Popoveniuc Cezar Cezar211 Data 17 noiembrie 2019 11:43:42
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.4 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("nim.in");
ofstream fout ("nim.out");
int T, n, x, s;
int main()
{
    fin >> T;
    while(T--)
    {
        fin >> n;
        int s = 0;
        for(int i=1; i<=n; i++)
        {
            fin >> x;
            s^=x;
        }
        if(!s)
            fout << "NU\n";
        else fout << "DA\n";
    }
    return 0;
}