結果

問題 No.2240 WAC
ユーザー shobonvipshobonvip
提出日時 2023-02-09 03:37:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 102,860 KB
最終ジャッジ日時 2023-09-20 15:46:17
合計ジャッジ時間 7,754 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,028 KB
testcase_01 AC 72 ms
70,904 KB
testcase_02 AC 77 ms
71,332 KB
testcase_03 AC 72 ms
71,132 KB
testcase_04 AC 73 ms
71,284 KB
testcase_05 AC 74 ms
71,236 KB
testcase_06 AC 73 ms
70,912 KB
testcase_07 AC 73 ms
71,288 KB
testcase_08 AC 73 ms
71,180 KB
testcase_09 AC 75 ms
71,220 KB
testcase_10 AC 112 ms
102,860 KB
testcase_11 AC 111 ms
102,756 KB
testcase_12 AC 111 ms
102,696 KB
testcase_13 AC 95 ms
83,116 KB
testcase_14 AC 87 ms
77,484 KB
testcase_15 AC 103 ms
93,764 KB
testcase_16 AC 106 ms
95,976 KB
testcase_17 AC 100 ms
89,052 KB
testcase_18 AC 86 ms
78,384 KB
testcase_19 AC 89 ms
81,028 KB
testcase_20 AC 105 ms
94,456 KB
testcase_21 AC 94 ms
85,532 KB
testcase_22 AC 95 ms
86,928 KB
testcase_23 AC 92 ms
83,560 KB
testcase_24 AC 104 ms
93,048 KB
testcase_25 AC 103 ms
91,456 KB
testcase_26 AC 92 ms
81,732 KB
testcase_27 AC 86 ms
78,328 KB
testcase_28 AC 91 ms
81,292 KB
testcase_29 AC 85 ms
76,636 KB
testcase_30 AC 97 ms
86,032 KB
testcase_31 AC 112 ms
100,048 KB
testcase_32 AC 89 ms
78,836 KB
testcase_33 AC 97 ms
87,572 KB
testcase_34 AC 102 ms
90,916 KB
testcase_35 AC 85 ms
75,992 KB
testcase_36 AC 105 ms
93,012 KB
testcase_37 AC 108 ms
96,968 KB
testcase_38 AC 94 ms
82,456 KB
testcase_39 AC 111 ms
99,360 KB
testcase_40 AC 99 ms
86,152 KB
testcase_41 AC 102 ms
91,096 KB
testcase_42 AC 103 ms
90,768 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