結果

問題 No.2240 WAC
ユーザー shobonvipshobonvip
提出日時 2023-03-06 00:42:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 66,812 KB
最終ジャッジ日時 2023-10-18 05:05:26
合計ジャッジ時間 3,818 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,484 KB
testcase_01 AC 37 ms
53,484 KB
testcase_02 WA -
testcase_03 AC 38 ms
53,484 KB
testcase_04 AC 40 ms
53,484 KB
testcase_05 AC 38 ms
53,484 KB
testcase_06 AC 38 ms
53,484 KB
testcase_07 AC 38 ms
53,484 KB
testcase_08 AC 37 ms
53,484 KB
testcase_09 WA -
testcase_10 AC 60 ms
64,868 KB
testcase_11 AC 61 ms
64,844 KB
testcase_12 WA -
testcase_13 AC 39 ms
53,740 KB
testcase_14 WA -
testcase_15 AC 39 ms
54,016 KB
testcase_16 AC 63 ms
66,636 KB
testcase_17 WA -
testcase_18 AC 57 ms
66,004 KB
testcase_19 AC 58 ms
65,988 KB
testcase_20 AC 39 ms
54,068 KB
testcase_21 AC 59 ms
66,296 KB
testcase_22 AC 39 ms
53,828 KB
testcase_23 AC 39 ms
53,740 KB
testcase_24 AC 40 ms
54,004 KB
testcase_25 AC 63 ms
66,480 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 38 ms
53,484 KB
testcase_29 AC 39 ms
53,484 KB
testcase_30 AC 39 ms
53,828 KB
testcase_31 WA -
testcase_32 AC 58 ms
65,988 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 63 ms
66,536 KB
testcase_37 AC 40 ms
54,156 KB
testcase_38 AC 38 ms
53,484 KB
testcase_39 AC 40 ms
54,288 KB
testcase_40 WA -
testcase_41 AC 40 ms
53,952 KB
testcase_42 AC 40 ms
53,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int,input().split())
s = input()
assert 1 <= n <= 10 ** 5
assert 1 <= m <= 10 ** 5

w = s.count("W")
a = s.count("A")
c = s.count("C")
assert w == n
assert a == n + m
assert c == m
assert len(s) == 2*(n+m)

pivot = 0
for i in range(2*(n+m)):
	if s[i] == "C":
		mode = 0
		while pivot < i and mode == 0:
			if s[pivot] == "A":
				mode = 1
			pivot += 1
		if mode == 0:
			print("No")
			exit()

for i in range(2*(n+m)):
	if s[i] == "W":
		mode = 0
		while pivot < 2*(n+m) and mode == 0:
			if s[pivot] == "A":
				mode = 1
			pivot += 1
		if mode == 0:
			print("No")
			exit()

print("Yes")
0