結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 04:55:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 1,360 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 240,584 KB
最終ジャッジ日時 2023-10-25 06:37:32
合計ジャッジ時間 11,108 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 795 ms
240,584 KB
testcase_01 AC 38 ms
53,316 KB
testcase_02 AC 38 ms
53,316 KB
testcase_03 AC 39 ms
53,316 KB
testcase_04 AC 38 ms
53,316 KB
testcase_05 AC 38 ms
53,316 KB
testcase_06 AC 39 ms
53,316 KB
testcase_07 AC 38 ms
53,316 KB
testcase_08 AC 38 ms
53,316 KB
testcase_09 AC 38 ms
53,316 KB
testcase_10 AC 38 ms
53,316 KB
testcase_11 AC 40 ms
53,316 KB
testcase_12 AC 39 ms
53,316 KB
testcase_13 AC 808 ms
238,304 KB
testcase_14 AC 812 ms
238,348 KB
testcase_15 AC 813 ms
238,476 KB
testcase_16 AC 811 ms
238,460 KB
testcase_17 AC 799 ms
238,324 KB
testcase_18 AC 795 ms
238,328 KB
testcase_19 AC 808 ms
238,308 KB
testcase_20 AC 812 ms
238,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
N = int(input())
S = reversed([input().split() for _ in range(N)])
p = [0, 0]
for i in S:
    a = int(i[1])
    if i[0] == 'C' and p[1] == a:
        b = p[0]-1
        if b<0:b=H-1
        p[0] = b
    if i[0] == 'R' and p[0] == a:
        b = p[1]-1
        if b<0:b=W-1
        p[1] = b
print('black' if (p[0]+p[1])%2 else 'white')
0