Cod sursa(job #2373590)

Utilizator YouDontNeedMyNameJurcut Paul YouDontNeedMyName Data 7 martie 2019 14:27:13
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.39 kb
#include <bits/stdc++.h>

using namespace std;
ifstream in("nim.in");
ofstream out("nim.out");
int n,t;
int main()
{
    in >> t;
    int xr=0;
    while(t--)
    {
        in >> n;
        xr=0;
        while(n--)
        {
            int x;
            in >> x;
            xr^=x;
        }
        if(xr) out << "DA\n";
        else out << "NU\n";
    }
    return 0;
}