Cod sursa(job #1767212)

Utilizator bciobanuBogdan Ciobanu bciobanu Data 28 septembrie 2016 20:08:07
Problema Xerox Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
using namespace std;

int main() {
  ifstream cin("xerox.in");
  ofstream cout("xerox.out");
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int num_tests; cin >> num_tests;
  for (int iter = 0; iter < num_tests; ++iter) {
    int useless; int nim = 0;
    int n; cin >> n >> useless >> useless;
    for (int i = 0; i < n; ++i) {
      int pile_size; cin >> pile_size;
      for (int j = 0; j < pile_size; ++j)
        cin >> useless >> useless;
      nim ^= pile_size;
    }
    cout << (nim != 0) << '\n';
  }
  return 0;
}