結果

問題 No.351 市松スライドパズル
ユーザー tonnnura172tonnnura172
提出日時 2020-04-27 16:01:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 584 ms / 2,000 ms
コード長 995 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 81,900 KB
実行使用メモリ 252,432 KB
最終ジャッジ日時 2024-05-01 15:24:23
合計ジャッジ時間 7,575 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 509 ms
250,108 KB
testcase_01 AC 56 ms
66,272 KB
testcase_02 AC 63 ms
66,176 KB
testcase_03 AC 63 ms
65,408 KB
testcase_04 AC 61 ms
66,176 KB
testcase_05 AC 61 ms
65,792 KB
testcase_06 AC 62 ms
65,536 KB
testcase_07 AC 62 ms
65,764 KB
testcase_08 AC 61 ms
65,280 KB
testcase_09 AC 59 ms
65,432 KB
testcase_10 AC 60 ms
65,664 KB
testcase_11 AC 61 ms
65,664 KB
testcase_12 AC 63 ms
65,664 KB
testcase_13 AC 544 ms
248,064 KB
testcase_14 AC 542 ms
248,980 KB
testcase_15 AC 551 ms
251,748 KB
testcase_16 AC 548 ms
251,876 KB
testcase_17 AC 524 ms
252,432 KB
testcase_18 AC 534 ms
251,772 KB
testcase_19 AC 584 ms
252,044 KB
testcase_20 AC 579 ms
251,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul, add
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()
N = INT()
SK = [input().split() for _ in range(N)]
i, j = 0, 0
for S, K in SK[::-1]:
	K = int(K)
	if S == "C":
		if K == j:
			i -= 1
			i %= H
	if S == "R":
		if K == i:
			j -= 1
			j %= W
print("white" if (i+j)%2==0 else "black")
0