Cod sursa(job #2999238)

Utilizator rARES_4Popa Rares rARES_4 Data 10 martie 2023 18:21:32
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.44 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f ("nim.in");
ofstream g ("nim.out");
int main()
{
    int t;
    int n;
    f >> t;
    for(int i = 1;i<=t;i++)
    {
        f >> n;
        int s = 0;
        for(int j = 1;j<=n;j++)
        {
            int x;
            f >> x;
            s = s^x;
        }
        if(s==0)
            g <<"NU\n";
        else
            g << "DA\n";
    }
}