Cod sursa(job #2776239)

Utilizator BogdanRazvanBogdan Razvan BogdanRazvan Data 19 septembrie 2021 01:42:04
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.58 kb
#include <bits/stdc++.h>

using namespace std;

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

void usain_bolt()
{
    ios::sync_with_stdio(false);
    fin.tie(0);
}

int main()
{
    usain_bolt();

    int tt;

    fin >> tt;
    for(; tt; --tt) {
        int n, xorr = 0;

        fin >> n;
        for(int i = 1; i <= n; ++i) {
            int x;

            fin >> x;
            xorr ^= x;
        }
        if(xorr) {
            fout << "DA" << "\n";
        }
        else {
            fout << "NU" << "\n";
        }
    }
    return 0;
}