Coding-Riddles/modern_art.py
2025-01-20 11:37:00 -05:00

28 lines
No EOL
645 B
Python

width = int(input(""))
height = int(input(""))
num_strokes = int(input(""))
rows = [0] * width
columns = [0] * height
for stroke in range(num_strokes):
target, number = input("").split(" ")
if target == "C":
for i in range(height):
print(i, int(number))
cells[i][int(number)-1] = not cells[i][int(number)-1]
print(cells)
else:
for i in range(width):
print(i, int(number))
cells[int(number)-1][i] = not cells[int(number)-1][i]
print(cells)
total = 0
for row in cells:
for cell in row:
if cell:
total += 1
print(total)