Cod sursa(job #1767210)

Utilizator bciobanuBogdan Ciobanu bciobanu Data 28 septembrie 2016 20:07:52
Problema Xerox Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 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 << '\n';
  }
  return 0;
}