Cod sursa(job #2982638)

Utilizator RobertlelRobert Robertlel Data 20 februarie 2023 17:13:42
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.46 kb
#include <iostream>
#include <fstream>
#include <map>

using namespace std;

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

int xors , n , i , k , a;

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

    return 0;
}