#K62662. Binary Matrix Inversion
Binary Matrix Inversion
Binary Matrix Inversion
You are given a binary matrix of dimensions \( R \times C \). The task is to invert the binary values of the matrix. Specifically, every 0 should be changed to 1 and every 1 changed to 0.
Input format: The first line contains two integers \( R \) and \( C \), representing the number of rows and columns in the matrix. Each of the next \( R \) lines contains \( C \) space-separated integers (either 0 or 1), representing the matrix.
Output format: Output the resultant matrix with the inverted binary values. Each row should be printed on a new line with values separated by a single space.
Example:
Input: 3 3 1 0 0 0 1 1 1 0 1</p>Output: 0 1 1 1 0 0 0 1 0
inputFormat
The input starts with a line containing two integers \( R \) and \( C \). Following this, there are \( R \) lines each containing \( C \) integers (0 or 1) separated by spaces.
outputFormat
Output the inverted matrix in the same \( R \times C \) format. Each row of the matrix is output on a new line with each integer separated by a space.
## sample3 3
1 0 0
0 1 1
1 0 1
0 1 1
1 0 0
0 1 0
</p>