結果

問題 No.2240 WAC
ユーザー hir355hir355
提出日時 2023-03-10 21:32:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 1,545 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 92,384 KB
最終ジャッジ日時 2023-10-18 07:13:47
合計ジャッジ時間 3,911 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,076 KB
testcase_01 AC 37 ms
53,076 KB
testcase_02 AC 38 ms
53,076 KB
testcase_03 AC 38 ms
53,076 KB
testcase_04 AC 38 ms
53,076 KB
testcase_05 AC 37 ms
53,076 KB
testcase_06 AC 37 ms
53,076 KB
testcase_07 AC 37 ms
53,076 KB
testcase_08 AC 37 ms
53,076 KB
testcase_09 AC 37 ms
53,076 KB
testcase_10 AC 76 ms
92,384 KB
testcase_11 AC 72 ms
92,376 KB
testcase_12 AC 69 ms
90,112 KB
testcase_13 AC 54 ms
70,516 KB
testcase_14 AC 49 ms
64,872 KB
testcase_15 AC 66 ms
83,324 KB
testcase_16 AC 70 ms
85,776 KB
testcase_17 AC 62 ms
78,896 KB
testcase_18 AC 51 ms
66,112 KB
testcase_19 AC 53 ms
68,540 KB
testcase_20 AC 67 ms
83,996 KB
testcase_21 AC 57 ms
73,096 KB
testcase_22 AC 56 ms
74,404 KB
testcase_23 AC 54 ms
71,064 KB
testcase_24 AC 65 ms
82,640 KB
testcase_25 AC 65 ms
81,088 KB
testcase_26 AC 51 ms
69,232 KB
testcase_27 AC 49 ms
65,776 KB
testcase_28 AC 52 ms
69,040 KB
testcase_29 AC 46 ms
64,224 KB
testcase_30 AC 59 ms
73,468 KB
testcase_31 AC 72 ms
89,524 KB
testcase_32 AC 49 ms
66,420 KB
testcase_33 AC 58 ms
75,032 KB
testcase_34 AC 63 ms
78,504 KB
testcase_35 AC 47 ms
63,732 KB
testcase_36 AC 66 ms
82,816 KB
testcase_37 AC 69 ms
86,812 KB
testcase_38 AC 53 ms
69,768 KB
testcase_39 AC 71 ms
89,020 KB
testcase_40 AC 57 ms
73,672 KB
testcase_41 AC 62 ms
78,740 KB
testcase_42 AC 63 ms
78,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
s = input()
w = []
a = []
c = []
for i in range((n + m) * 2):
    if s[i] == 'W':
        w.append(i)
    elif s[i] == 'A':
        a.append(i)
    else:
        c.append(i)
for i in range(n):
    if w[i] > a[i + m]:
        print('No')
        exit(0)
for i in range(m):
    if a[i] > c[i]:
        print('No')
        exit(0)
print('Yes')
0