結果
| 問題 | 
                            No.351 市松スライドパズル
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-03-20 13:45:58 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 797 ms / 2,000 ms | 
| コード長 | 343 bytes | 
| コンパイル時間 | 213 ms | 
| コンパイル使用メモリ | 82,456 KB | 
| 実行使用メモリ | 234,552 KB | 
| 最終ジャッジ日時 | 2024-11-20 22:53:47 | 
| 合計ジャッジ時間 | 10,475 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 17 | 
ソースコード
H, W = map(int, input().split())
N = int(input())
op = [list(input().split()) for i in range(N)]
op = op[::-1]
r, c = 0, 0
for i in range(N):
    if op[i][0] == "R" and int(op[i][1]) == r:
        c = (c - 1) % W
    if op[i][0] == "C" and int(op[i][1]) == c:
        r = (r - 1) % H
if (r + c) % 2:
    print("black")
else:
    print("white")