結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 586 ms
209,672 KB
testcase_01 AC 73 ms
71,456 KB
testcase_02 AC 73 ms
71,256 KB
testcase_03 AC 75 ms
71,600 KB
testcase_04 AC 74 ms
71,516 KB
testcase_05 AC 73 ms
71,188 KB
testcase_06 AC 74 ms
71,368 KB
testcase_07 AC 75 ms
71,580 KB
testcase_08 AC 73 ms
71,260 KB
testcase_09 AC 74 ms
71,060 KB
testcase_10 AC 74 ms
71,220 KB
testcase_11 AC 73 ms
71,508 KB
testcase_12 AC 73 ms
71,416 KB
testcase_13 AC 689 ms
240,352 KB
testcase_14 AC 694 ms
240,604 KB
testcase_15 AC 709 ms
241,412 KB
testcase_16 AC 706 ms
241,688 KB
testcase_17 AC 698 ms
238,236 KB
testcase_18 AC 690 ms
236,576 KB
testcase_19 AC 698 ms
241,560 KB
testcase_20 AC 704 ms
241,320 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-=1
            if y<0:
                y=W-1
    else:
        if B[i]==y:
            x-=1
            if x<0:
                x=H-1
if (x+y)%2:
    print('black')
else :
    print('white')
0