結果

問題 No.2240 WAC
ユーザー lloyzlloyz
提出日時 2023-03-10 23:07:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 81,148 KB
実行使用メモリ 79,736 KB
最終ジャッジ日時 2023-10-18 08:49:43
合計ジャッジ時間 3,933 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,312 KB
testcase_01 AC 38 ms
53,312 KB
testcase_02 AC 38 ms
53,312 KB
testcase_03 AC 38 ms
53,312 KB
testcase_04 AC 37 ms
53,312 KB
testcase_05 WA -
testcase_06 AC 38 ms
53,312 KB
testcase_07 AC 37 ms
53,312 KB
testcase_08 AC 37 ms
53,312 KB
testcase_09 AC 36 ms
53,312 KB
testcase_10 AC 59 ms
79,736 KB
testcase_11 AC 57 ms
79,192 KB
testcase_12 AC 53 ms
78,728 KB
testcase_13 AC 41 ms
59,796 KB
testcase_14 AC 46 ms
62,352 KB
testcase_15 AC 45 ms
66,200 KB
testcase_16 WA -
testcase_17 AC 54 ms
71,348 KB
testcase_18 AC 47 ms
64,720 KB
testcase_19 WA -
testcase_20 AC 47 ms
68,636 KB
testcase_21 AC 50 ms
68,320 KB
testcase_22 AC 44 ms
62,612 KB
testcase_23 AC 42 ms
59,796 KB
testcase_24 AC 46 ms
66,124 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 47 ms
62,616 KB
testcase_28 AC 40 ms
59,300 KB
testcase_29 AC 39 ms
53,972 KB
testcase_30 AC 43 ms
62,628 KB
testcase_31 WA -
testcase_32 AC 46 ms
62,568 KB
testcase_33 AC 54 ms
71,052 KB
testcase_34 WA -
testcase_35 AC 45 ms
61,944 KB
testcase_36 WA -
testcase_37 AC 48 ms
69,196 KB
testcase_38 AC 41 ms
59,340 KB
testcase_39 AC 48 ms
72,072 KB
testcase_40 WA -
testcase_41 AC 46 ms
65,800 KB
testcase_42 AC 45 ms
65,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a_num = 0
for i in range(2 * (n + m)):
    if S[i] == 'A':
        a_num += 1
    elif S[i] == 'C':
        if a_num > 0:
            a_num -= 1
        else:
            print("No")
            exit()
    else:
        if a_num == n:
            print("No")
            exit()
print("Yes")
0