Cod sursa(job #805387)
Utilizator | Data | 31 octombrie 2012 12:49:52 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <fstream>
using namespace std;
int main()
{
int t;
ifstream f("nim.in");
ofstream g("nim.out");
f >> t;
int n, x, s;
while(t--) {
f >> n;
s = 0;
while(n--) {
f >> x;
s ^=x ;
}
g << (s > 0?"DA\n":"NU\n");
}
}