結果

問題 No.2240 WAC
ユーザー titiatitia
提出日時 2023-03-10 21:49:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 264 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 11,792 KB
実行使用メモリ 30,824 KB
最終ジャッジ日時 2023-10-18 07:34:43
合計ジャッジ時間 5,219 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,044 KB
testcase_01 AC 29 ms
10,044 KB
testcase_02 AC 29 ms
10,044 KB
testcase_03 AC 29 ms
10,044 KB
testcase_04 AC 28 ms
10,044 KB
testcase_05 AC 28 ms
10,044 KB
testcase_06 AC 29 ms
10,044 KB
testcase_07 AC 29 ms
10,044 KB
testcase_08 AC 29 ms
10,044 KB
testcase_09 AC 29 ms
10,044 KB
testcase_10 AC 245 ms
30,816 KB
testcase_11 AC 264 ms
30,824 KB
testcase_12 AC 135 ms
18,512 KB
testcase_13 AC 29 ms
10,296 KB
testcase_14 AC 29 ms
10,144 KB
testcase_15 AC 30 ms
10,548 KB
testcase_16 AC 225 ms
20,972 KB
testcase_17 AC 29 ms
10,452 KB
testcase_18 AC 80 ms
14,372 KB
testcase_19 AC 93 ms
11,300 KB
testcase_20 AC 30 ms
10,696 KB
testcase_21 AC 123 ms
22,040 KB
testcase_22 AC 119 ms
12,088 KB
testcase_23 AC 113 ms
12,508 KB
testcase_24 AC 188 ms
22,356 KB
testcase_25 AC 185 ms
22,000 KB
testcase_26 AC 29 ms
10,240 KB
testcase_27 AC 30 ms
10,152 KB
testcase_28 AC 109 ms
14,252 KB
testcase_29 AC 56 ms
10,700 KB
testcase_30 AC 29 ms
10,388 KB
testcase_31 AC 29 ms
10,752 KB
testcase_32 AC 74 ms
14,864 KB
testcase_33 AC 29 ms
10,420 KB
testcase_34 AC 29 ms
10,500 KB
testcase_35 AC 28 ms
10,120 KB
testcase_36 AC 196 ms
29,008 KB
testcase_37 AC 29 ms
10,720 KB
testcase_38 AC 104 ms
20,432 KB
testcase_39 AC 255 ms
29,164 KB
testcase_40 AC 30 ms
10,388 KB
testcase_41 AC 186 ms
16,568 KB
testcase_42 AC 181 ms
15,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

LIST=[]

now=len(S)-1
for i in range(len(S)-1,-1,-1):
    if S[i]=="W":
        while S[now]!="A":
            now-=1

        if i<now:
            LIST.append(i)
            LIST.append(now)
            now-=1
        else:
            print("No")
            exit()

nozoku=set(LIST)

S2=[]
for i in range(len(S)):
    if i in nozoku:
        continue
    else:
        S2.append(S[i])

S=S2
now=len(S)-1
for i in range(len(S)-1,-1,-1):
    if S[i]=="A":
        while S[now]!="C":
            now-=1

        if i<now:
            now-=1
        else:
            print("No")
            exit()

print("Yes")
0