結果

問題 No.2240 WAC
ユーザー shobonvipshobonvip
提出日時 2023-02-09 03:37:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 92,288 KB
最終ジャッジ日時 2024-07-06 10:51:39
合計ジャッジ時間 4,036 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,584 KB
testcase_01 AC 29 ms
51,328 KB
testcase_02 AC 31 ms
51,840 KB
testcase_03 AC 30 ms
51,840 KB
testcase_04 AC 29 ms
51,584 KB
testcase_05 AC 30 ms
51,712 KB
testcase_06 AC 29 ms
52,096 KB
testcase_07 AC 30 ms
51,812 KB
testcase_08 AC 30 ms
51,840 KB
testcase_09 AC 30 ms
51,456 KB
testcase_10 AC 70 ms
92,288 KB
testcase_11 AC 65 ms
91,648 KB
testcase_12 AC 65 ms
92,288 KB
testcase_13 AC 49 ms
71,552 KB
testcase_14 AC 42 ms
65,664 KB
testcase_15 AC 58 ms
82,560 KB
testcase_16 AC 59 ms
85,504 KB
testcase_17 AC 54 ms
78,336 KB
testcase_18 AC 43 ms
66,944 KB
testcase_19 AC 44 ms
68,480 KB
testcase_20 AC 59 ms
83,840 KB
testcase_21 AC 48 ms
73,472 KB
testcase_22 AC 50 ms
75,136 KB
testcase_23 AC 46 ms
71,680 KB
testcase_24 AC 55 ms
81,792 KB
testcase_25 AC 56 ms
80,512 KB
testcase_26 AC 46 ms
69,632 KB
testcase_27 AC 41 ms
66,816 KB
testcase_28 AC 46 ms
70,272 KB
testcase_29 AC 40 ms
63,744 KB
testcase_30 AC 50 ms
74,368 KB
testcase_31 AC 63 ms
89,088 KB
testcase_32 AC 43 ms
66,304 KB
testcase_33 AC 52 ms
76,032 KB
testcase_34 AC 55 ms
80,128 KB
testcase_35 AC 42 ms
63,232 KB
testcase_36 AC 57 ms
82,048 KB
testcase_37 AC 62 ms
86,528 KB
testcase_38 AC 46 ms
70,528 KB
testcase_39 AC 63 ms
89,088 KB
testcase_40 AC 52 ms
74,880 KB
testcase_41 AC 55 ms
80,256 KB
testcase_42 AC 55 ms
79,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int,input().split())
s = input()

w = []
a = []
c = []
for i in range(2*n + 2*m):
	if s[i] == "W":
		w.append(i)
	if s[i] == "A":
		a.append(i)
	if s[i] == "C":
		c.append(i)

mode = 1
for i in range(m):
	if a[i] > c[i]:
		mode = 0
for i in range(n):
	if w[i] > a[i+m]:
		mode = 0

if mode:
	print("Yes")
else:
	print("No")
0