Cod sursa(job #2260158)

Utilizator FunnyStockyMihnea Andreescu FunnyStocky Data 14 octombrie 2018 15:22:55
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.48 kb
/**
Я собираюсь выиграть Шумен
**/
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int main(){
    int t,n,x,s;
    fin>>t;
    while(t--)
    {
        fin>>n;
        s=0;
        while(n--)
        {
            fin>>x;
            s^=x;
        }
        if(s) fout<<"DA\n"; /// игрок выигрывает
        else fout<<"NU\n"; /// проигрыватель проигрывает
    }
}