結果

問題 No.2240 WAC
ユーザー lloyzlloyz
提出日時 2023-03-10 23:23:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 640 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,500 KB
実行使用メモリ 95,036 KB
最終ジャッジ日時 2023-10-18 09:11:10
合計ジャッジ時間 7,173 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,352 KB
testcase_01 AC 42 ms
53,352 KB
testcase_02 AC 42 ms
53,352 KB
testcase_03 AC 43 ms
53,352 KB
testcase_04 AC 42 ms
53,352 KB
testcase_05 AC 41 ms
53,352 KB
testcase_06 AC 42 ms
53,352 KB
testcase_07 AC 42 ms
53,352 KB
testcase_08 AC 42 ms
53,352 KB
testcase_09 AC 43 ms
53,352 KB
testcase_10 AC 555 ms
94,772 KB
testcase_11 AC 640 ms
94,936 KB
testcase_12 AC 85 ms
95,036 KB
testcase_13 AC 46 ms
61,876 KB
testcase_14 AC 67 ms
69,008 KB
testcase_15 AC 51 ms
68,280 KB
testcase_16 AC 213 ms
90,868 KB
testcase_17 AC 162 ms
88,360 KB
testcase_18 AC 73 ms
71,384 KB
testcase_19 AC 57 ms
69,712 KB
testcase_20 AC 52 ms
68,668 KB
testcase_21 AC 301 ms
86,568 KB
testcase_22 AC 49 ms
64,692 KB
testcase_23 AC 48 ms
61,876 KB
testcase_24 AC 51 ms
68,208 KB
testcase_25 AC 287 ms
89,292 KB
testcase_26 AC 188 ms
73,832 KB
testcase_27 AC 74 ms
71,332 KB
testcase_28 AC 47 ms
61,384 KB
testcase_29 AC 44 ms
56,052 KB
testcase_30 AC 48 ms
64,708 KB
testcase_31 AC 442 ms
92,404 KB
testcase_32 AC 87 ms
71,256 KB
testcase_33 AC 166 ms
88,840 KB
testcase_34 AC 430 ms
90,088 KB
testcase_35 AC 58 ms
66,536 KB
testcase_36 AC 375 ms
89,800 KB
testcase_37 AC 52 ms
71,276 KB
testcase_38 AC 46 ms
61,424 KB
testcase_39 AC 53 ms
74,152 KB
testcase_40 AC 131 ms
87,232 KB
testcase_41 AC 51 ms
67,880 KB
testcase_42 AC 51 ms
67,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n, m = map(int, input().split())
S = list(input())

A = deque()
W = deque()
for i in range(2 * (n + m)):
    if S[i] == 'A':
        A.append(i)
    elif S[i] == 'C':
        if len(A) > 0:
            A.popleft()
        else:
            print("No")
            exit()
    else:
        W.append(i)

for i in range(n):
    if A[i] < W[i]:
        print("No")
        exit()
print("Yes")
0