結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
JunOnuma
|
| 提出日時 | 2017-05-23 18:32:19 |
| 言語 | Python2 (2.7.18) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 353 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 93,696 KB |
| 最終ジャッジ日時 | 2024-09-25 03:11:56 |
| 合計ジャッジ時間 | 22,204 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 TLE * 8 |
ソースコード
h,w = map(int, raw_input().split())
k = int(raw_input())
l = [raw_input() for _ in range(k)]
x = 0
y = 0
i = k-1
while i >= 0:
c = l[i][0]
j = int(l[i][2:])
if c == 'R' and y == int(j):
x = (x+w-1) % w
elif c == 'C' and x == int(j):
y = (y+h-1) % h
i -= 1
if (x+y) % 2 == 0:
print 'white'
else:
print 'black'
JunOnuma