Cod sursa(job #717284)

Utilizator Sm3USmeu Rares Sm3U Data 19 martie 2012 19:55:14
Problema Jocul NIM Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.48 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 ^= x;
        }
        if (s){
            printf ("DA\n");
        }else{
            printf ("NU\n");
        }

    }

    return 0;
}