結果

問題 No.2240 WAC
ユーザー ntudantuda
提出日時 2023-04-28 12:10:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2024-04-28 18:27:51
合計ジャッジ時間 4,859 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,580 KB
testcase_01 AC 38 ms
51,880 KB
testcase_02 AC 39 ms
52,208 KB
testcase_03 AC 37 ms
52,876 KB
testcase_04 AC 37 ms
51,960 KB
testcase_05 AC 39 ms
52,484 KB
testcase_06 AC 38 ms
52,512 KB
testcase_07 AC 38 ms
52,348 KB
testcase_08 AC 36 ms
52,580 KB
testcase_09 AC 38 ms
53,144 KB
testcase_10 AC 68 ms
76,412 KB
testcase_11 AC 67 ms
76,364 KB
testcase_12 AC 67 ms
76,008 KB
testcase_13 AC 38 ms
53,504 KB
testcase_14 AC 45 ms
63,776 KB
testcase_15 AC 40 ms
55,688 KB
testcase_16 AC 68 ms
75,980 KB
testcase_17 AC 50 ms
73,744 KB
testcase_18 AC 56 ms
72,892 KB
testcase_19 AC 58 ms
75,444 KB
testcase_20 AC 38 ms
54,380 KB
testcase_21 AC 61 ms
75,452 KB
testcase_22 AC 38 ms
53,584 KB
testcase_23 AC 38 ms
53,664 KB
testcase_24 AC 39 ms
54,280 KB
testcase_25 AC 66 ms
76,004 KB
testcase_26 AC 47 ms
66,628 KB
testcase_27 AC 47 ms
65,288 KB
testcase_28 AC 38 ms
54,804 KB
testcase_29 AC 39 ms
52,088 KB
testcase_30 AC 37 ms
53,472 KB
testcase_31 AC 57 ms
75,752 KB
testcase_32 AC 54 ms
72,764 KB
testcase_33 AC 50 ms
72,988 KB
testcase_34 AC 57 ms
75,424 KB
testcase_35 AC 48 ms
61,880 KB
testcase_36 AC 68 ms
75,820 KB
testcase_37 AC 41 ms
54,388 KB
testcase_38 AC 39 ms
53,628 KB
testcase_39 AC 41 ms
54,888 KB
testcase_40 AC 50 ms
71,892 KB
testcase_41 AC 39 ms
54,280 KB
testcase_42 AC 39 ms
53,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
S = input()
NS = len(S)
a,w,c = 0,0,0

for i in range(NS):
    s = S[i]
    if s == "A":
        a += 1
    elif s == "C":
        c += 1
    if a < c:
        print("No")
        exit()

a,w,c = 0,0,0

for i in reversed(range(NS)):
    s = S[i]
    if s == "A":
        a += 1
    elif s == "W":
        w += 1
    if a < w:
        print("No")
        exit()
print("Yes")
0