結果
| 問題 | No.351 市松スライドパズル |
| コンテスト | |
| ユーザー |
Snark86
|
| 提出日時 | 2016-03-11 23:16:52 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 287 ms / 2,000 ms |
| コード長 | 313 bytes |
| 記録 | |
| コンパイル時間 | 267 ms |
| コンパイル使用メモリ | 77,464 KB |
| 最終ジャッジ日時 | 2025-12-03 19:43:44 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
import sys lines = sys.stdin.readlines() H, W = map(int,lines[0].strip().split()) r = 0 c = 0 N = len(lines) - 2 for i in range(N): a,b = lines[N+1-i].strip().split() if a == "R" and int(b) == c: r = (r+W-1) % W elif a == "C" and int(b) == r: c = (c+H-1) % H color = ["white","black"] print color[(r+c)%2]
Snark86