Cod sursa(job #2049264)
Utilizator | Data | 26 octombrie 2017 23:43:26 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream fin("nim.in");
ofstream fout("nim.out");
int t,n,x,sol=0;
fin>>t;
while(t--)
{
fin>>n;
for(;n;n--)
{
fin>>x;
sol^=x;
}
if(sol==0)fout<<"NU\n";
else fout<<"DA\n";
}
return 0;
}