結果
問題 | No.351 市松スライドパズル |
ユーザー | fumofumofuni |
提出日時 | 2021-09-14 20:17:07 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 698 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 81,980 KB |
実行使用メモリ | 240,036 KB |
最終ジャッジ日時 | 2024-06-27 11:10:46 |
合計ジャッジ時間 | 8,584 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
H,W=map(int,input().split()) N=int(input()) A=[] B=[] for i in range(N): x,y=input().split() A.append(x) B.append(int(y)) list.reverse(A) list.reverse(B) x=0 y=0 for i in range(N): if A[i]=='R': if B[i]==x: y=(y-1+W)%W else: if B[i]==y: x=(x-1+H)%H if (x+y)%2: print('black') else : print('white')