結果
問題 | No.351 市松スライドパズル |
ユーザー | akitsugu777 |
提出日時 | 2019-07-30 14:50:16 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 730 ms |
コンパイル使用メモリ | 10,816 KB |
実行使用メモリ | 418,604 KB |
最終ジャッジ日時 | 2023-09-17 23:12:15 |
合計ジャッジ時間 | 11,628 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | AC | 16 ms
7,780 KB |
testcase_02 | AC | 16 ms
7,760 KB |
testcase_03 | AC | 16 ms
7,764 KB |
testcase_04 | AC | 16 ms
7,708 KB |
testcase_05 | AC | 16 ms
7,704 KB |
testcase_06 | AC | 16 ms
7,788 KB |
testcase_07 | AC | 16 ms
7,772 KB |
testcase_08 | AC | 15 ms
7,820 KB |
testcase_09 | AC | 15 ms
7,780 KB |
testcase_10 | AC | 16 ms
7,896 KB |
testcase_11 | AC | 16 ms
7,956 KB |
testcase_12 | AC | 16 ms
7,948 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
ソースコード
h, w = map(int,input().split()) n = int(input()) l = [input().split() for _ in range(n)] h -= 1 w -= 1 x = y = 0 for s, k in l[::-1]: k = int(k) if s == 'R' and k == y: if x-1 < 0: x = w else: x -= 1 elif s == 'C' and k == x: if y-1 < 0: y = h else: y -= 1 print('white' if (x+y) % 2 == 0 else 'black')