結果

問題 No.2240 WAC
ユーザー 👑 H20H20
提出日時 2023-03-10 23:11:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 1,499 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 108,364 KB
最終ジャッジ日時 2023-10-18 08:54:32
合計ジャッジ時間 5,298 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
53,404 KB
testcase_01 AC 43 ms
53,404 KB
testcase_02 AC 44 ms
53,404 KB
testcase_03 AC 43 ms
53,404 KB
testcase_04 AC 43 ms
53,404 KB
testcase_05 AC 44 ms
53,404 KB
testcase_06 AC 42 ms
53,404 KB
testcase_07 AC 43 ms
53,404 KB
testcase_08 AC 42 ms
53,404 KB
testcase_09 AC 42 ms
53,404 KB
testcase_10 AC 112 ms
106,540 KB
testcase_11 AC 114 ms
108,364 KB
testcase_12 AC 110 ms
108,224 KB
testcase_13 AC 75 ms
85,520 KB
testcase_14 AC 57 ms
71,308 KB
testcase_15 AC 89 ms
95,088 KB
testcase_16 AC 101 ms
97,740 KB
testcase_17 AC 84 ms
90,968 KB
testcase_18 AC 65 ms
75,392 KB
testcase_19 AC 66 ms
77,796 KB
testcase_20 AC 91 ms
96,392 KB
testcase_21 AC 83 ms
87,236 KB
testcase_22 AC 79 ms
88,140 KB
testcase_23 AC 79 ms
86,312 KB
testcase_24 AC 94 ms
94,740 KB
testcase_25 AC 97 ms
93,828 KB
testcase_26 AC 62 ms
76,948 KB
testcase_27 AC 59 ms
73,976 KB
testcase_28 AC 77 ms
85,032 KB
testcase_29 AC 57 ms
69,192 KB
testcase_30 AC 80 ms
87,328 KB
testcase_31 AC 99 ms
101,180 KB
testcase_32 AC 64 ms
74,828 KB
testcase_33 AC 83 ms
88,696 KB
testcase_34 AC 85 ms
92,352 KB
testcase_35 AC 54 ms
66,388 KB
testcase_36 AC 96 ms
95,008 KB
testcase_37 AC 96 ms
98,852 KB
testcase_38 AC 78 ms
85,860 KB
testcase_39 AC 105 ms
101,500 KB
testcase_40 AC 80 ms
87,568 KB
testcase_41 AC 89 ms
92,580 KB
testcase_42 AC 88 ms
91,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

N,M = map(int, input().split())
S = list(input())
A = collections.deque()
W = []
C = []
for i,s in enumerate(S):
    if s=='A':
        A.append(i)
    if s=='W':
        W.append(i)
    if s=='C':
        C.append(i)

for w in W[::-1]:
    if w<A[-1]:
        A.pop()
    else:
        print('No')
        exit()

for c in C:
    if A[0]<c:
        A.popleft()
    else:
        print('No')
        exit()
print('Yes')
0