Cod sursa(job #2915479)

Utilizator AlexandruBenescuAlexandru Benescu AlexandruBenescu Data 22 iulie 2022 19:13:43
Problema Xerox Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin("xerox.in");
ofstream fout("xerox.out");
int main(){
  int t, n, m, x;
  string useless;
  for (fin >> t; t; t--){
    x = 0;
    for (fin >> n, getline(fin, useless); n; n--){
      fin >> m;
      getline(fin, useless);
      x ^= m;
    }
    if (x)
      x = 1;
    fout << x << "\n";
  }
  return 0;
}