Cod sursa(job #717286)

Utilizator Sm3USmeu Rares Sm3U Data 19 martie 2012 19:58:42
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.49 kb
#include <cstdio>

using namespace std;

int main()
{
    freopen ("nim.in", "r", stdin);
    freopen ("nim.out", "w", stdout);

    int m;
    scanf ("%d", &m);
    while (m --){
        int x;
        int s = 0;
        scanf ("%d", &x);
        while (x --){
            int y;
            scanf ("%d", &y);
            s = s ^ y;
        }
        if (s){
            printf ("DA\n");
        }else{
            printf ("NU\n");
        }

    }

    return 0;
}