結果
| 問題 | No.351 市松スライドパズル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-20 13:46:42 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 358 ms / 2,000 ms |
| コード長 | 382 bytes |
| 記録 | |
| コンパイル時間 | 187 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 235,760 KB |
| 最終ジャッジ日時 | 2026-05-15 04:13:21 |
| 合計ジャッジ時間 | 5,449 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
import sys
input = sys.stdin.readline
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")