結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2016-03-11 22:56:41 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 668 ms / 2,000 ms |
コード長 | 441 bytes |
コンパイル時間 | 556 ms |
コンパイル使用メモリ | 76,840 KB |
実行使用メモリ | 245,176 KB |
最終ジャッジ日時 | 2024-09-25 02:30:50 |
合計ジャッジ時間 | 9,204 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
H,W = map(int,raw_input().split()) N = int(raw_input()) SK = [raw_input().split() for i in xrange(N)] hx = hy = 0 for i in xrange(N-1,-1,-1): s,k = SK[i] 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"