結果

問題 No.2240 WAC
ユーザー ikomaikoma
提出日時 2023-03-11 01:13:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 733 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 97,220 KB
最終ジャッジ日時 2023-10-18 09:28:18
合計ジャッジ時間 4,494 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,544 KB
testcase_01 AC 37 ms
53,544 KB
testcase_02 AC 37 ms
53,544 KB
testcase_03 AC 37 ms
53,544 KB
testcase_04 AC 38 ms
53,544 KB
testcase_05 AC 38 ms
53,544 KB
testcase_06 AC 37 ms
53,544 KB
testcase_07 AC 38 ms
53,544 KB
testcase_08 AC 37 ms
53,544 KB
testcase_09 AC 37 ms
53,544 KB
testcase_10 AC 92 ms
97,220 KB
testcase_11 AC 90 ms
97,220 KB
testcase_12 AC 92 ms
97,220 KB
testcase_13 AC 67 ms
75,500 KB
testcase_14 AC 59 ms
69,280 KB
testcase_15 AC 95 ms
89,724 KB
testcase_16 AC 97 ms
92,316 KB
testcase_17 AC 87 ms
86,960 KB
testcase_18 AC 70 ms
73,940 KB
testcase_19 AC 63 ms
72,356 KB
testcase_20 AC 97 ms
91,076 KB
testcase_21 AC 75 ms
77,384 KB
testcase_22 AC 82 ms
85,000 KB
testcase_23 AC 72 ms
77,128 KB
testcase_24 AC 91 ms
89,760 KB
testcase_25 AC 90 ms
89,244 KB
testcase_26 AC 64 ms
72,464 KB
testcase_27 AC 61 ms
71,740 KB
testcase_28 AC 68 ms
74,844 KB
testcase_29 AC 58 ms
68,928 KB
testcase_30 AC 82 ms
85,032 KB
testcase_31 AC 104 ms
94,544 KB
testcase_32 AC 60 ms
71,652 KB
testcase_33 AC 85 ms
85,988 KB
testcase_34 AC 97 ms
88,196 KB
testcase_35 AC 60 ms
68,724 KB
testcase_36 AC 90 ms
89,440 KB
testcase_37 AC 99 ms
92,660 KB
testcase_38 AC 64 ms
74,888 KB
testcase_39 AC 109 ms
95,164 KB
testcase_40 AC 84 ms
85,044 KB
testcase_41 AC 86 ms
88,508 KB
testcase_42 AC 90 ms
88,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

    ok=[0]*len(S)
    r=len(ok)
    for i in range(len(S)-1,-1,-1):
        s=S[i]
        if s=="W":
            while r>0:
                r-=1
                if S[r]=="A":
                    if i<r:
                        ok[i]=1
                        ok[r]=1
                    break
    l=-1
    for i,s in enumerate(S):
        if s=="A" and ok[i]==0:
            while l<len(ok)-1:
                l+=1
                if S[l]=="C":
                    if i<l:
                        ok[i]=1
                        ok[l]=1
                    break
    print("Yes" if sum(ok)==len(ok) else "No")

solve()
0