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