結果

問題 No.2240 WAC
ユーザー neterukunneterukun
提出日時 2023-03-10 21:48:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,516 KB
実行使用メモリ 122,892 KB
最終ジャッジ日時 2023-10-18 07:34:11
合計ジャッジ時間 4,476 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 38 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 38 ms
53,332 KB
testcase_04 AC 37 ms
53,332 KB
testcase_05 WA -
testcase_06 AC 38 ms
53,332 KB
testcase_07 AC 38 ms
53,332 KB
testcase_08 AC 38 ms
53,332 KB
testcase_09 AC 38 ms
53,332 KB
testcase_10 AC 92 ms
92,804 KB
testcase_11 AC 75 ms
89,512 KB
testcase_12 AC 127 ms
122,892 KB
testcase_13 AC 73 ms
85,304 KB
testcase_14 AC 56 ms
73,212 KB
testcase_15 AC 85 ms
90,856 KB
testcase_16 WA -
testcase_17 AC 83 ms
90,744 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 92 ms
94,636 KB
testcase_21 WA -
testcase_22 AC 62 ms
76,132 KB
testcase_23 AC 69 ms
81,960 KB
testcase_24 AC 89 ms
91,748 KB
testcase_25 WA -
testcase_26 AC 62 ms
80,448 KB
testcase_27 AC 58 ms
76,460 KB
testcase_28 AC 62 ms
80,304 KB
testcase_29 AC 53 ms
68,036 KB
testcase_30 AC 77 ms
85,920 KB
testcase_31 AC 98 ms
99,980 KB
testcase_32 WA -
testcase_33 AC 83 ms
92,552 KB
testcase_34 AC 87 ms
94,748 KB
testcase_35 AC 54 ms
69,160 KB
testcase_36 WA -
testcase_37 AC 99 ms
97,720 KB
testcase_38 AC 73 ms
86,368 KB
testcase_39 AC 99 ms
99,912 KB
testcase_40 AC 81 ms
90,408 KB
testcase_41 AC 79 ms
85,856 KB
testcase_42 AC 77 ms
84,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


stack = []
for char in s:
    if char == "C" and stack and stack[-1] == "A":
        stack.pop()
    else:
        stack.append(char)

stack2 = []
for char in stack:
    if char == "A" and stack2 and stack2[-1] == "W":
        stack2.pop()
    else:
        stack2.append(char)

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