Cod sursa(job #1399865)

Utilizator iordache.bogdanIordache Ioan-Bogdan iordache.bogdan Data 24 martie 2015 22:47:21
Problema Xerox Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.62 kb
#include <fstream>
#include <algorithm>

#define DIM 205
#define infile "xerox.in"
#define outfile "xerox.out"

using namespace std;

ifstream fin(infile);
ofstream fout(outfile);

int main() {

	int querysCount;

	fin >> querysCount;

	for (; querysCount; --querysCount) {

		int n, bullshit;

		fin >> n >> bullshit >> bullshit;

		int xorSum = 0;

		for (int i = 1; i <= n; ++i) {

			int m;

			fin >> m;

			xorSum ^= m;

			for (int j = 1; j <= 2 * m; ++j)
				fin >> bullshit;

		}

		fout << (xorSum ? 1 : 0) << '\n';

	}

	return 0;
}

//Trust me, I'm the Doctor!
//Miriam e tare!