結果
| 問題 | 
                            No.351 市松スライドパズル
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Konton7
                         | 
                    
| 提出日時 | 2019-05-23 23:06:57 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1,333 ms / 2,000 ms | 
| コード長 | 446 bytes | 
| コンパイル時間 | 112 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 65,536 KB | 
| 最終ジャッジ日時 | 2024-09-17 09:54:48 | 
| 合計ジャッジ時間 | 15,074 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 17 | 
ソースコード
import sys
input = sys.stdin.readline
h, w = [ int(v) for v in input().split() ]
n = int(input())
rotate_list = [ "" for i in range(n) ]
for i in range(n):
	rotate_list[i] = input()
y, x = 0, 0
for i in range(n):
	s = rotate_list[n-1-i]
	
	ope, target = s.split(" ")
	if int(target) == y:
		if ope == "R":
			x = (x-1) % w
	if int(target) == x:
		if ope == "C":
			y = (y-1) % h
if (x + y) % 2 == 0:
	print("white")
else:
	print("black")
            
            
            
        
            
Konton7