結果

問題 No.351 市松スライドパズル
コンテスト
ユーザー akitsugu777
提出日時 2019-07-30 13:40:36
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 566 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,170 ms
コンパイル使用メモリ 21,408 KB
実行使用メモリ 796,028 KB
最終ジャッジ日時 2026-08-06 12:54:09
合計ジャッジ時間 10,596 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 RE * 2 MLE * 1 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h, w = map(int,input().split())
l = '01' * ((w+1)//2)

l2 = []
for i in range(h):
    if i % 2 == 0:
        l2.append(list(l[0:w]))
    else:
        l2.append(list(l[1:w+1]))

n = int(input())
for _ in range(n):
    s, k = input().split()
    k = int(k)
    if s == 'R':
        x = l2[k].pop() 
        l2[k].insert(0, x)
    else:
        l3 = []
        for i in range(h):
            l3.append(l2[i][k])
            x = l3.pop()
            l3.insert(0, x)
        for i in range(h):
            l2[i][k] = l3[i]

print('black' if l2[0][0] == '1' else 'white')
0