Cod sursa(job #2850238)

Utilizator valentinchipuc123Valentin Chipuc valentinchipuc123 Data 16 februarie 2022 13:54:13
Problema Xerox Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <bits/stdc++.h>

using namespace std;

ifstream f("nim.in");
ofstream g("nim.out");

void solve()
{
    int n,sumxor=0;
    f>>n;
    for(int i=1; i<=n; i++)
    {
        int x;
        f>>x;
        sumxor^=x;
    }
    if(sumxor!=0) g<<"DA"<<'\n';
    else g<<"NU"<<'\n';
}

int main()
{
    int teste;
    f>>teste;
    while(teste--)
        solve();
}