#37192: python 紀錄


BensonDC (python戰士)

School : No School
ID : 240921
IP address : [163.32.78.214]
Last Login :
2024-11-06 14:27:58
b965. 2. 矩陣轉換 -- 2016年3月apcs | From: [36.238.105.93] | Post Date : 2023-08-24 13:08

while True:
    try:
        R,C,M=map(int,input().split())
    except EOFError:
        break
    L=[]
    for i in range(R):
        L.append([int(x) for x in input().split()])
    op=[int(x) for x in input().split()][::-1]
    for opi in op:
        if opi==0:
            Ltemp=[[0 for _ in range(len(L))] for _ in range(len(L[0]))]
            for i in range(len(L)):
                for j in range(len(L[0])):
                    Ltemp[len(L[0])-1-j][i]=L[i][j]
            L=Ltemp
        else:
            L=L[::-1]
    print(len(L),len(L[0]))
    for i in L:
        print(*i)

 
ZeroJudge Forum