Cod sursa(job #2487090)

Utilizator armigheGheorghe Liviu Armand armighe Data 3 noiembrie 2019 22:03:53
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.4 kb
#include<fstream>
using namespace std;
ifstream f("nim.in");
ofstream g("nim.out");

int main()
{
    int t,i,j,n,sol,x;
    f>>t;
    for(j=1;j<=t;j++)
    {
        f>>n;
        sol=0;
        for(i=1;i<=n;i++)
        {
            f>>x;
            sol^=x;
        }
        if(sol==0)
            g<<"NU"<<'\n';
        else
            g<<"DA"<<'\n';
    }
    return 0;
}