Cod sursa(job #3226721)

Utilizator MilitaruMihai2022Millitaru Mihai MilitaruMihai2022 Data 22 aprilie 2024 17:21:47
Problema Jocul NIM Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.37 kb
#include <iostream>
#include <fstream>

using namespace std;

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

int main()
{
    int T, N, x, S;
    f >> T;
    while (T--)
    {
        fin >> N;
        S = 0;
        while (N--)
        {
            f >> x;
            S^=x;
        }
        g << (S != 0 ? "DA\n" : "NU\n");
    }
    f.close();
    g.close();
    return 0;
}