結果

問題 No.2240 WAC
ユーザー FromBooskaFromBooska
提出日時 2023-04-30 19:42:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 827 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 94,080 KB
最終ジャッジ日時 2024-04-29 23:57:01
合計ジャッジ時間 4,638 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,584 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 40 ms
51,712 KB
testcase_03 AC 40 ms
51,584 KB
testcase_04 AC 40 ms
51,584 KB
testcase_05 AC 40 ms
51,840 KB
testcase_06 AC 41 ms
51,840 KB
testcase_07 AC 40 ms
51,840 KB
testcase_08 AC 42 ms
51,712 KB
testcase_09 AC 40 ms
52,096 KB
testcase_10 AC 82 ms
94,080 KB
testcase_11 AC 80 ms
92,800 KB
testcase_12 AC 81 ms
92,928 KB
testcase_13 AC 62 ms
71,424 KB
testcase_14 AC 57 ms
65,024 KB
testcase_15 AC 75 ms
83,328 KB
testcase_16 AC 77 ms
85,888 KB
testcase_17 AC 71 ms
78,464 KB
testcase_18 AC 58 ms
66,944 KB
testcase_19 AC 59 ms
68,352 KB
testcase_20 AC 76 ms
84,480 KB
testcase_21 AC 64 ms
73,728 KB
testcase_22 AC 67 ms
75,136 KB
testcase_23 AC 63 ms
71,552 KB
testcase_24 AC 74 ms
83,072 KB
testcase_25 AC 73 ms
81,280 KB
testcase_26 AC 61 ms
69,760 KB
testcase_27 AC 59 ms
66,560 KB
testcase_28 AC 62 ms
70,272 KB
testcase_29 AC 55 ms
63,872 KB
testcase_30 AC 66 ms
74,752 KB
testcase_31 AC 83 ms
90,368 KB
testcase_32 AC 59 ms
66,560 KB
testcase_33 AC 68 ms
76,544 KB
testcase_34 AC 73 ms
80,896 KB
testcase_35 AC 54 ms
62,976 KB
testcase_36 AC 76 ms
83,584 KB
testcase_37 AC 79 ms
87,680 KB
testcase_38 AC 63 ms
70,912 KB
testcase_39 AC 83 ms
89,856 KB
testcase_40 AC 66 ms
75,136 KB
testcase_41 AC 73 ms
81,408 KB
testcase_42 AC 72 ms
81,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 右からN個のAはWA用
# 左からM個のAはAC用
# A, AC用のAの場所をリスト化して、1つずつAより右にあればOK
# WAも同様
# 両方のテストをクリアすればYesか

N, M = map(int, input().split())
S = input()
A_list = []
C_list = []
W_list = []
for i in range(N*2+M*2):
    if S[i] == 'A':
        A_list.append(i)
    elif S[i] == 'C':
        C_list.append(i)
    elif S[i] == 'W':
        W_list.append(i)
#print(A_list)
A_forAC = A_list[:M]
A_forWA = A_list[M:]
        
#print(A_forAC, C_list)
#print(W_list, A_forWA)

AC_test = True
for i in range(M):
    if A_forAC[i] > C_list[i]:
        AC_test = False
        
WA_test = True
for i in range(N):
    if W_list[i] > A_forWA[i]:
        WA_test = False

if AC_test == True and WA_test == True:
    print('Yes')
else:
    print('No')
0