結果
| 問題 | 
                            No.351 市松スライドパズル
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-01-20 03:27:22 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 905 ms / 2,000 ms | 
| コード長 | 317 bytes | 
| コンパイル時間 | 352 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 250,624 KB | 
| 最終ジャッジ日時 | 2024-11-23 14:15:28 | 
| 合計ジャッジ時間 | 12,118 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 17 | 
ソースコード
h, w = map(int, input().split())
n = int(input())
sk = [input().split() for _ in range(n)]
i = j = 0
for s, k in sk[::-1]:
    k = int(k)
    if s == "R" and k == i:
        j = (j - 1) % w
    elif s == "C" and k == j:
        i = (i - 1) % h
if (i + j) % 2 == 0:
    print("white")
else:
    print("black")