結果

問題 No.2240 WAC
ユーザー KudeKude
提出日時 2023-03-10 21:48:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,608 KB
実行使用メモリ 67,876 KB
最終ジャッジ日時 2023-10-18 07:34:15
合計ジャッジ時間 3,441 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 38 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 38 ms
53,332 KB
testcase_04 AC 39 ms
53,332 KB
testcase_05 AC 38 ms
53,332 KB
testcase_06 AC 38 ms
53,332 KB
testcase_07 AC 38 ms
53,332 KB
testcase_08 AC 38 ms
53,332 KB
testcase_09 AC 38 ms
53,332 KB
testcase_10 AC 59 ms
67,876 KB
testcase_11 AC 55 ms
65,684 KB
testcase_12 WA -
testcase_13 AC 39 ms
54,656 KB
testcase_14 AC 48 ms
62,096 KB
testcase_15 AC 41 ms
55,948 KB
testcase_16 AC 61 ms
66,904 KB
testcase_17 WA -
testcase_18 AC 55 ms
64,472 KB
testcase_19 AC 54 ms
64,624 KB
testcase_20 AC 41 ms
56,168 KB
testcase_21 AC 53 ms
63,320 KB
testcase_22 AC 40 ms
55,084 KB
testcase_23 AC 40 ms
54,656 KB
testcase_24 AC 41 ms
55,904 KB
testcase_25 AC 58 ms
66,300 KB
testcase_26 WA -
testcase_27 AC 47 ms
62,224 KB
testcase_28 AC 40 ms
54,280 KB
testcase_29 AC 39 ms
53,660 KB
testcase_30 AC 40 ms
55,092 KB
testcase_31 WA -
testcase_32 AC 55 ms
64,420 KB
testcase_33 AC 50 ms
63,564 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 58 ms
66,440 KB
testcase_37 AC 41 ms
56,488 KB
testcase_38 AC 39 ms
54,300 KB
testcase_39 AC 41 ms
56,972 KB
testcase_40 WA -
testcase_41 AC 40 ms
55,716 KB
testcase_42 AC 40 ms
55,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = input()
l = len(s)
used = [0] * l
q = []
i = 0
for j in range(l):
    if s[j] == 'C':
        while i < j and s[i] != 'A':
            i += 1
        if i == j:
            print('No')
            exit()
        used[i] = 1
        i += 1
j = l - 1
for i in range(l)[::-1]:
    if s[i] == 'W':
        while j > i and (s[j] != 'A' or used[j]):
            j -= 1
        if j == i:
            print('No')
            exit()
print('Yes')
0