只有#1測資過
程式如下
p = input().split()
r = int(p[0])
c = int(p[1])
m = int(p[2])
bl = []
def flip():
global bl,r,c,m
copy_bl = bl
bl = []
for k in range(len(copy_bl)-1,-1,-1):
bl.append(copy_bl[k])
def turn():
global bl,r,c,m
copy_bl = bl
bl = []
copy_l = len(copy_bl)
copy_w = len(copy_bl[0])
for i in range(copy_w-1,-1,-1):
x = []
for k in range(copy_l):
x.append(copy_bl[k][i])
bl.append(x)
for i in range(r):
x = input().split(" ")
for j in range(len(x)):
x[j] = int(x[j])
bl.append(x)
move = input().split(' ')
move.reverse()
for t in range(m):
if move[t]=="0":
turn()
else:
flip()
print(len(bl),end=" ")
print(len(bl[0]))
for i in range(len(bl)):
print(*bl[i])
move = input().split(' ')
改成input().split()
move = input().split(' ')
改成input().split()
感謝QWQ