ArefiX's blog

By ArefiX, history, 4 hours ago, In English

Text format: Binary Matrix

Problem Statement:

A matrix is called binary if all its elements are either 0 or 1.

Ecrade calls a binary matrix good if the following two properties hold:

  1. The bitwise XOR of all numbers in each row of the matrix is equal to 0.
  1. The bitwise XOR of all numbers in each column of the matrix is equal to 0.

Ecrade has a binary matrix of size n × m. He is interested in finding the minimum number of elements that need to be changed for the matrix to become good.

Input:

Each test contains multiple test cases.

The first line contains the number of test cases t (1 ≤ t ≤ 400).

The first line of each test case contains two integers n, m (1 ≤ n, m ≤ 100).

This is followed by n lines, each containing exactly m characters (0 or 1), describing the elements of Ecrade's matrix.

It is guaranteed that the sum of n * m across all test cases does not exceed 5 × 10⁴.

Output:

For each test case, output a single integer:

The minimum number of elements that need to be changed.

  • Vote: I like it
  • -23
  • Vote: I do not like it

»
4 hours ago, # |
  Vote: I like it +6 Vote: I do not like it

Auto comment: topic has been updated by ArefiX (previous revision, new revision, compare).

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Don't downvote, i am helping humanity

»
4 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

And what exactly you received by leaking the already leaked problemset as an entire blog other than Some Downvotes ??

The round is unrated; no one would achieve anything by knowing the problem beforehand.. All you're doing is making programmers less interested about a contest which was made with lot of dedication by problem setters and ruined by a technical issue..

Do they (problemsetters and testers) deserve this really ??

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    "The round is unrated"- it was not unrated when I posted this. "Leaking already leaked solution"-donno if it was already leaked, I didn't go through indian telegram groups. This post was made to force te round to be unrated,proving the pset really leaked. If you took the caption literally, and really though I was selling like indian cheaters, then Mr. Boomer, I have nothing to say.

    • »
      »
      »
      3 hours ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Don't downvote, i am helping humanity

      First of all; stop being Racist.. By that way; you will not be helping the humanity.. You are going nowhere by stereotyping and having hate towards Indians that only Indians are cheaters or all cheaters are Indians !!

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    No the setters and testers don't deserve this, I agree on this point.