結果

問題 No.351 市松スライドパズル
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-14 20:17:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 702 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 241,760 KB
最終ジャッジ日時 2023-09-09 18:35:09
合計ジャッジ時間 9,387 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 582 ms
209,384 KB
testcase_01 AC 72 ms
71,312 KB
testcase_02 AC 72 ms
71,524 KB
testcase_03 AC 70 ms
71,552 KB
testcase_04 AC 71 ms
71,556 KB
testcase_05 AC 71 ms
71,284 KB
testcase_06 AC 71 ms
71,380 KB
testcase_07 AC 72 ms
71,416 KB
testcase_08 AC 71 ms
71,484 KB
testcase_09 AC 73 ms
71,112 KB
testcase_10 AC 72 ms
71,268 KB
testcase_11 AC 73 ms
71,328 KB
testcase_12 AC 73 ms
71,356 KB
testcase_13 AC 691 ms
240,128 KB
testcase_14 AC 685 ms
240,820 KB
testcase_15 AC 694 ms
241,540 KB
testcase_16 AC 702 ms
241,444 KB
testcase_17 AC 697 ms
238,180 KB
testcase_18 AC 688 ms
236,472 KB
testcase_19 AC 693 ms
241,760 KB
testcase_20 AC 698 ms
241,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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')
0