結果

問題 No.351 市松スライドパズル
ユーザー matsukin1111matsukin1111
提出日時 2018-12-15 13:33:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 951 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 183,676 KB
最終ジャッジ日時 2023-10-25 21:47:12
合計ジャッジ時間 8,240 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

H_W = list(map(int,input().split()))
N = int(input())
data = [input().split() for l in range(N)]


m = [[0 for i in range(H_W[1])] for j in range(H_W[0])]

s = 0
ss = 0
for i in range(H_W[0]):
        for j in range(H_W[1]):
                m[i][j] = 0 if s%2==0 else 1
                s += 1
        ss += 1
        s = 0 if ss % 2 ==0 else 1


temp = 0
for i in range(N):
        if (data[i][0] == 'R'):
                temp = m[int(data[i][1])][H_W[1]-1]
                for j in range(H_W[1]-2,-1,-1):
                        m[int(data[i][1])][j+1] = m[int(data[i][1])][j]
                m[int(data[i][1])][0] = temp 
                        
        elif (data[i][0] == 'C'):
                temp = m[H_W[0]-1][int(data[i][1])]
                for j in range(H_W[0]-2,-1,-1):
                        m[j+1][int(data[i][1])] = m[j][int(data[i][1])]
                m[0][int(data[i][1])] = temp

print("white") if m[0][0] == 0 else print("black")
0