結果

問題 No.2240 WAC
ユーザー rlangevinrlangevin
提出日時 2023-03-10 21:34:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 94,464 KB
最終ジャッジ日時 2023-10-18 07:17:11
合計ジャッジ時間 3,903 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,468 KB
testcase_01 AC 38 ms
53,468 KB
testcase_02 AC 38 ms
53,468 KB
testcase_03 AC 37 ms
53,468 KB
testcase_04 AC 38 ms
53,468 KB
testcase_05 AC 38 ms
53,468 KB
testcase_06 AC 38 ms
53,468 KB
testcase_07 AC 38 ms
53,468 KB
testcase_08 AC 38 ms
53,468 KB
testcase_09 AC 39 ms
53,468 KB
testcase_10 AC 90 ms
94,452 KB
testcase_11 AC 85 ms
94,460 KB
testcase_12 AC 78 ms
94,464 KB
testcase_13 AC 52 ms
68,028 KB
testcase_14 AC 47 ms
64,504 KB
testcase_15 AC 57 ms
74,428 KB
testcase_16 AC 70 ms
78,244 KB
testcase_17 AC 56 ms
71,452 KB
testcase_18 AC 58 ms
67,036 KB
testcase_19 AC 56 ms
67,364 KB
testcase_20 AC 61 ms
74,816 KB
testcase_21 AC 60 ms
70,628 KB
testcase_22 AC 60 ms
73,036 KB
testcase_23 AC 57 ms
70,224 KB
testcase_24 AC 69 ms
76,556 KB
testcase_25 AC 70 ms
76,396 KB
testcase_26 AC 50 ms
65,244 KB
testcase_27 AC 49 ms
64,772 KB
testcase_28 AC 60 ms
69,736 KB
testcase_29 AC 52 ms
64,400 KB
testcase_30 AC 55 ms
70,860 KB
testcase_31 AC 62 ms
78,012 KB
testcase_32 AC 55 ms
66,928 KB
testcase_33 AC 53 ms
71,152 KB
testcase_34 AC 56 ms
73,912 KB
testcase_35 AC 46 ms
62,048 KB
testcase_36 AC 70 ms
76,640 KB
testcase_37 AC 60 ms
77,420 KB
testcase_38 AC 59 ms
69,764 KB
testcase_39 AC 93 ms
92,700 KB
testcase_40 AC 54 ms
70,864 KB
testcase_41 AC 66 ms
76,236 KB
testcase_42 AC 66 ms
76,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
S = list(input())
w, a, c = 0, 0, 0
for i in range(len(S)):
    if S[i] == "W":
        w += 1
    elif S[i] == "A":
        if w:
            w -= 1
if w:
    print("No")
    exit()
     
S.reverse()       
w, a, c = 0, 0, 0
for i in range(len(S)):
    if S[i] == "C":
        c += 1
    elif S[i] == "A":
        if c:
            c -= 1
if c:
    print("No")
    exit()
    
print("Yes")
0