結果

問題 No.2240 WAC
ユーザー minimumminimum
提出日時 2023-03-10 21:34:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 93,168 KB
最終ジャッジ日時 2023-10-18 07:16:05
合計ジャッジ時間 4,019 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,140 KB
testcase_01 AC 38 ms
53,140 KB
testcase_02 AC 38 ms
53,140 KB
testcase_03 AC 38 ms
53,140 KB
testcase_04 AC 38 ms
53,140 KB
testcase_05 AC 38 ms
53,140 KB
testcase_06 AC 38 ms
53,140 KB
testcase_07 AC 38 ms
53,140 KB
testcase_08 AC 38 ms
53,140 KB
testcase_09 AC 38 ms
53,140 KB
testcase_10 AC 79 ms
93,168 KB
testcase_11 AC 76 ms
93,164 KB
testcase_12 AC 73 ms
93,144 KB
testcase_13 AC 57 ms
71,576 KB
testcase_14 AC 52 ms
66,224 KB
testcase_15 AC 69 ms
84,536 KB
testcase_16 AC 74 ms
86,432 KB
testcase_17 AC 65 ms
77,752 KB
testcase_18 AC 55 ms
69,292 KB
testcase_19 AC 56 ms
68,532 KB
testcase_20 AC 70 ms
85,656 KB
testcase_21 AC 61 ms
75,112 KB
testcase_22 AC 59 ms
74,472 KB
testcase_23 AC 58 ms
72,672 KB
testcase_24 AC 69 ms
83,216 KB
testcase_25 AC 69 ms
81,972 KB
testcase_26 AC 56 ms
69,356 KB
testcase_27 AC 52 ms
66,856 KB
testcase_28 AC 56 ms
70,016 KB
testcase_29 AC 51 ms
64,196 KB
testcase_30 AC 62 ms
76,672 KB
testcase_31 AC 75 ms
91,172 KB
testcase_32 AC 53 ms
67,892 KB
testcase_33 AC 62 ms
76,156 KB
testcase_34 AC 64 ms
79,272 KB
testcase_35 AC 49 ms
63,616 KB
testcase_36 AC 68 ms
83,268 KB
testcase_37 AC 72 ms
88,408 KB
testcase_38 AC 56 ms
71,448 KB
testcase_39 AC 75 ms
90,024 KB
testcase_40 AC 60 ms
75,032 KB
testcase_41 AC 66 ms
79,680 KB
testcase_42 AC 66 ms
79,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
S = input()

w, al, ar, c = [], [], [], []
for i in range(2 * N + 2 * M):
    if S[i] == 'W':
        w.append(i)
    elif S[i] == 'C':
        c.append(i)
    elif len(al) < M:
        al.append(i)
    else:
        ar.append(i)


for i in range(N):
    if w[i] > ar[i]:
        exit(print('No'))

for i in range(M):
    if c[i] < al[i]:
        exit(print('No'))


print('Yes')
0