結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2025-03-20 21:13:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 773 ms / 2,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 247,408 KB |
最終ジャッジ日時 | 2025-03-20 21:14:43 |
合計ジャッジ時間 | 10,144 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
H, W = map(int, input().split()) N = int(input()) operations = [] for _ in range(N): S, K = input().split() operations.append((S, int(K))) i, j = 0, 0 for op in reversed(operations): S, K = op if S == 'R': if i == K: j = (j - 1) % W else: if j == K: i = (i - 1) % H if (i + j) % 2 == 0: print("white") else: print("black")