Cod sursa(job #2034946)

Utilizator vladm98Munteanu Vlad vladm98 Data 8 octombrie 2017 18:10:05
Problema Jocul NIM Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.34 kb
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	ifstream fin ("nim.in");
	ofstream fout ("nim.out");
	int t;
	fin >> t;
	while (t--)
	{
		int xr = 0;
		int n;
		fin >> n;
		for (int i = 1; i<=n; ++i)
		{
			int x;
			fin >> x;
			xr ^= x;
		}
		if (xr) fout << "DA";
		else fout << "NU";
	}
	return 0;
}