Cod sursa(job #3345693)

Utilizator robertcosacCosac Robert-Mihai robertcosac Data 10 martie 2026 17:25:57
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("nim.in");
ofstream g("nim.out");
signed main ()
{
    int t;
    f >> t;
    while (t--)
    {
        int n;
        f >> n;
        int ans=0;
        while (n--)
        {
            int x;
            f >> x;
            ans=(ans^x);
        }
        if (ans) g <<"DA\n";
        else g <<"NU\n";
    }
}