結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2016-03-12 00:13:10 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 450 bytes |
コンパイル時間 | 64 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 206,876 KB |
最終ジャッジ日時 | 2024-09-25 01:35:49 |
合計ジャッジ時間 | 9,255 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 6 WA * 2 TLE * 2 -- * 7 |
ソースコード
H,W = map(int,raw_input().split()) N = int(raw_input()) tile = [[(i + j) % 2 for j in range(W)]for i in range(H)] for i in range(N): S,K = raw_input().split() K = int(K) if S == 'R': right = tile[K][W - 1] for c in range(1,W): tile[K][c] = tile[K][c - 1] tile[K][0] = right else: bottom = tile[H - 1][K] for r in range(1,H): tile[r][K] = tile[r - 1][K] tile[0][K] = bottom if tile[0][0] == 0: print 'white' else: print 'black'