結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2016-04-14 19:59:48 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 663 ms / 2,000 ms |
コード長 | 239 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 76,932 KB |
実行使用メモリ | 247,312 KB |
最終ジャッジ日時 | 2024-09-25 03:00:50 |
合計ジャッジ時間 | 9,072 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
h,w=map(int,raw_input().split()) n=input() x=0 y=0 for sk in[raw_input().split()for i in xrange(n)][::-1]: #print sk,x,y k=int(sk[1]) if ord(sk[0])==82: if y==k: x=(x-1+w)%w elif x==k: y=(y-1+h)%h print["white","black"][x&1^y&1]