結果
| 問題 | No.351 市松スライドパズル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-11 22:39:16 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,629 ms / 2,000 ms |
| + 304µs | |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 21,468 KB |
| 実行使用メモリ | 116,140 KB |
| 最終ジャッジ日時 | 2026-09-03 15:36:52 |
| 合計ジャッジ時間 | 20,090 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
#!/usr/bin/env python3
h, w = map(int,input().split())
n = int(input())
ops = [(lambda s, k: (s, int(k)))(*input().split()) for i in range(n)]
y, x = 0, 0
for s, k in reversed(ops):
if s == 'R':
if y == k:
x = (x - 1) % w
elif s == 'C':
if x == k:
y = (y - 1) % h
print(y % 2 == x % 2 and 'white' or 'black')