Cod sursa(job #642514)
| Utilizator | Data | 1 decembrie 2011 16:21:29 | |
|---|---|---|---|
| Problema | Xerox | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
//xerox_nim_compact.cpp
#include <fstream>
using namespace std;
int T, N, M, x, y, win;
ifstream f("xerox.in");
ofstream g("xerox.out");
int main(void)
{
for(f >> T; T; --T)
{
win = 0;
for(f >> N >> x >> y; N; --N)
{
f >> M;
win = win ^ M;
for(int j = 1; j <= M; ++j)
f >> x >> y;
}
g << (win > 0) << "\n";
}
f.close();
g.close();
return 0;
}