add to gothib
This commit is contained in:
commit
523f45b46a
28 changed files with 419 additions and 0 deletions
28
modern_art.py
Normal file
28
modern_art.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue