結果

問題 No.2240 WAC
ユーザー KudeKude
提出日時 2023-03-10 21:50:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 81,596 KB
実行使用メモリ 68,972 KB
最終ジャッジ日時 2023-10-18 07:35:49
合計ジャッジ時間 4,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,348 KB
testcase_01 AC 38 ms
53,348 KB
testcase_02 AC 38 ms
53,348 KB
testcase_03 AC 39 ms
53,348 KB
testcase_04 AC 38 ms
53,348 KB
testcase_05 AC 39 ms
53,348 KB
testcase_06 AC 38 ms
53,348 KB
testcase_07 AC 38 ms
53,348 KB
testcase_08 AC 38 ms
53,348 KB
testcase_09 AC 39 ms
53,348 KB
testcase_10 AC 60 ms
67,892 KB
testcase_11 AC 57 ms
65,688 KB
testcase_12 AC 60 ms
67,884 KB
testcase_13 AC 40 ms
54,668 KB
testcase_14 AC 48 ms
62,100 KB
testcase_15 AC 41 ms
55,960 KB
testcase_16 AC 66 ms
68,972 KB
testcase_17 AC 51 ms
63,740 KB
testcase_18 AC 63 ms
68,632 KB
testcase_19 AC 58 ms
66,700 KB
testcase_20 AC 41 ms
56,180 KB
testcase_21 AC 62 ms
67,472 KB
testcase_22 AC 41 ms
55,096 KB
testcase_23 AC 40 ms
54,668 KB
testcase_24 AC 41 ms
55,916 KB
testcase_25 AC 64 ms
68,376 KB
testcase_26 AC 48 ms
62,472 KB
testcase_27 AC 47 ms
62,228 KB
testcase_28 AC 40 ms
54,292 KB
testcase_29 AC 38 ms
53,672 KB
testcase_30 AC 40 ms
55,104 KB
testcase_31 AC 57 ms
67,320 KB
testcase_32 AC 58 ms
66,492 KB
testcase_33 AC 49 ms
63,568 KB
testcase_34 AC 49 ms
63,956 KB
testcase_35 AC 48 ms
62,036 KB
testcase_36 AC 62 ms
68,508 KB
testcase_37 AC 42 ms
56,500 KB
testcase_38 AC 38 ms
54,312 KB
testcase_39 AC 41 ms
56,984 KB
testcase_40 AC 54 ms
65,596 KB
testcase_41 AC 41 ms
55,728 KB
testcase_42 AC 42 ms
55,684 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()
        j -= 1
print('Yes')
0