#P9023. [CCC 2021 J5/S2] Modern Art
[CCC 2021 J5/S2] Modern Art
Problem Description
Maintain a matrix, where the initial matrix is all .
Each operation flips one row or one column ( becomes , and becomes ).
Output how many 's there are in the end.
Input Format
The first line contains , the number of rows of the matrix.
The second line contains , the number of columns of the matrix.
The third line contains , the number of operations.
The next lines each contain one character and one number. The character R means operating on a row, and C means a column. The number indicates which row or which column.
Output Format
One line with one number, representing the final number of 's.
3
3
2
R 1
C 1
4
4
5
7
R 3
C 1
C 2
R 2
R 2
C 1
R 4
10
Hint
Sample explanation:
011 01000
100 01000
100 10111
10111
Constraints:
Translated from CCC2021 J5/S2。
Translated by ChatGPT 5