結果

問題 No.351 市松スライドパズル
ユーザー FromBooskaFromBooska
提出日時 2023-02-28 21:39:37
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 832 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 838,128 KB
最終ジャッジ日時 2023-10-14 04:14:09
合計ジャッジ時間 8,123 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 472 ms
77,276 KB
testcase_01 AC 73 ms
70,988 KB
testcase_02 AC 71 ms
71,172 KB
testcase_03 AC 73 ms
71,104 KB
testcase_04 AC 72 ms
71,300 KB
testcase_05 AC 73 ms
71,280 KB
testcase_06 AC 71 ms
71,252 KB
testcase_07 AC 71 ms
71,280 KB
testcase_08 AC 71 ms
71,392 KB
testcase_09 AC 74 ms
70,964 KB
testcase_10 AC 74 ms
71,440 KB
testcase_11 AC 74 ms
71,276 KB
testcase_12 AC 72 ms
71,184 KB
testcase_13 MLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 愚直に全部シミュレーションするのか、それとももっと賢い方法があるのか
# まずは愚直にやってみる
# 最初に白黒表を作る愚直もあるし、どの座標がどの座標に移ったのかの愚直もある

H, W = map(int, input().split())
grid = [[0]*W for i in range(H)]
for h in range(H):
    for w in range(W):
        if (h+w)%2 == 1:
            grid[h][w] = 1


N = int(input())
for i in range(N):
    s, k = map(str, input().split())
    if s == 'R':
        k = int(k)
        new = [grid[k][-1]] + grid[k][:-1]
        grid[k] = new
    elif s == 'C':
        k = int(k)
        temp = grid[-1][k]
        for h in range(1, H):
            grid[h][k] = grid[h-1][k]
        grid[0][k] = temp
    #print(grid)

if grid[0][0] == 0:
    print('white')
else:
    print('black')
0