結果

問題 No.351 市松スライドパズル
ユーザー JunOnumaJunOnuma
提出日時 2017-05-23 18:32:19
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 353 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 7,048 KB
実行使用メモリ 93,444 KB
最終ジャッジ日時 2023-10-25 07:57:05
合計ジャッジ時間 22,852 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

h,w = map(int, raw_input().split())
k = int(raw_input())
l = [raw_input() for _ in range(k)]
x = 0
y = 0
i = k-1
while i >= 0:
    c = l[i][0]
    j = int(l[i][2:])
    if c == 'R' and y == int(j):
        x = (x+w-1) % w
    elif c == 'C' and x == int(j):
        y = (y+h-1) % h
    i -= 1
if (x+y) % 2 == 0:
    print 'white'
else:
    print 'black'
0