Cod sursa(job #3036805)

Utilizator Emmy432622Rotariu Emanuel Emmy432622 Data 25 martie 2023 09:47:14
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.47 kb
#include <bits/stdc++.h>

using namespace std;

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

int main()
{
    int t;
    fin >> t;

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