結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
LayCurse
|
| 提出日時 | 2016-03-11 23:12:38 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 1,054 ms / 2,000 ms |
| コード長 | 462 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 7,072 KB |
| 実行使用メモリ | 68,620 KB |
| 最終ジャッジ日時 | 2024-09-25 02:34:28 |
| 合計ジャッジ時間 | 11,324 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
import sys
ARR = sys.stdin.read().splitlines()
H,W = ARR[0].split()
H = int(H)
W = int(W)
N = ARR[1]
N = int(N)
hx = hy = 0
for i in xrange(N-1,-1,-1):
s,k = ARR[i+2].split()
k = int(k)
if s == "R":
if k == hy:
hx = hx - 1
if hx == -1:
hx = W - 1
else:
if k == hx:
hy = hy - 1
if hy == -1:
hy = H - 1
print "white" if (hx + hy) % 2 == 0 else "black"
LayCurse