結果

問題 No.2240 WAC
ユーザー 👑 KazunKazun
提出日時 2023-03-10 21:42:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 720 ms
コンパイル使用メモリ 81,692 KB
実行使用メモリ 72,896 KB
最終ジャッジ日時 2023-10-18 07:27:26
合計ジャッジ時間 4,093 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,252 KB
testcase_01 AC 39 ms
53,252 KB
testcase_02 AC 39 ms
53,252 KB
testcase_03 AC 38 ms
53,252 KB
testcase_04 AC 38 ms
53,252 KB
testcase_05 AC 39 ms
53,252 KB
testcase_06 AC 38 ms
53,252 KB
testcase_07 AC 39 ms
53,252 KB
testcase_08 AC 38 ms
53,252 KB
testcase_09 AC 39 ms
53,252 KB
testcase_10 AC 62 ms
72,896 KB
testcase_11 AC 58 ms
62,692 KB
testcase_12 AC 58 ms
62,696 KB
testcase_13 AC 39 ms
53,560 KB
testcase_14 AC 45 ms
59,116 KB
testcase_15 AC 39 ms
53,836 KB
testcase_16 AC 60 ms
62,260 KB
testcase_17 AC 51 ms
63,892 KB
testcase_18 AC 47 ms
59,116 KB
testcase_19 AC 48 ms
59,116 KB
testcase_20 AC 39 ms
53,888 KB
testcase_21 AC 52 ms
59,576 KB
testcase_22 AC 40 ms
53,648 KB
testcase_23 AC 39 ms
53,560 KB
testcase_24 AC 40 ms
53,824 KB
testcase_25 AC 58 ms
68,136 KB
testcase_26 AC 47 ms
61,168 KB
testcase_27 AC 47 ms
61,168 KB
testcase_28 AC 38 ms
53,304 KB
testcase_29 AC 38 ms
53,304 KB
testcase_30 AC 39 ms
53,648 KB
testcase_31 AC 56 ms
62,452 KB
testcase_32 AC 47 ms
59,116 KB
testcase_33 AC 50 ms
61,768 KB
testcase_34 AC 51 ms
61,928 KB
testcase_35 AC 44 ms
59,120 KB
testcase_36 AC 57 ms
62,056 KB
testcase_37 AC 39 ms
53,976 KB
testcase_38 AC 38 ms
53,304 KB
testcase_39 AC 39 ms
54,108 KB
testcase_40 AC 50 ms
61,708 KB
testcase_41 AC 40 ms
53,772 KB
testcase_42 AC 39 ms
53,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(S,a,b):
    k=0
    for i in range(len(S)):
        if S[i]==a:
            k+=1
        elif S[i]==b:
            k-=1
        if k<0:
            return False
    return True

def solve():
    N,M=map(int,input().split())
    S=input()

    return check(S,"A","C") and check(S[::-1], "A","W")

#==================================================
print("Yes" if solve() else "No")
0