Cod sursa(job #1181758)

Utilizator TimeAttackTimer Roby TimeAttack Data 3 mai 2014 17:00:14
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
/*
    Keep It Simple!
*/

#include<fstream>
using namespace std;

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

    int T;
    f >> T;

    while(T--)
    {
        int N,x;
        f >> N;

        int s = 0;
        for(int i=1;i<=N;i++)
        {
            f >> x;
            s ^= x;
        }

        if(s > 0)
            g << "DA\n";
        else
            g << "NU\n";
    }
}