Cod sursa(job #3227338)

Utilizator Gergo123Schradi Gergo Gergo123 Data 29 aprilie 2024 19:39:44
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.37 kb
#include <iostream>
#include <fstream>

using namespace std;

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

int main()
{
    int t,n;
    fin>>t;
    while(t--){
        fin>>n;
        int s=0,x;
        while(n--){
            fin>>x;
            s^=x;
        }
        if(s!=0) fout<<"DA"<<endl;
        else fout<<"NU"<<endl;
    }
    return 0;
}