結果

問題 No.2240 WAC
ユーザー shotoyooshotoyoo
提出日時 2023-03-10 21:27:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 994 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 107,172 KB
最終ジャッジ日時 2023-10-18 07:07:42
合計ジャッジ時間 4,674 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
56,128 KB
testcase_01 AC 43 ms
56,128 KB
testcase_02 AC 42 ms
56,128 KB
testcase_03 AC 41 ms
56,128 KB
testcase_04 AC 41 ms
56,128 KB
testcase_05 AC 42 ms
56,128 KB
testcase_06 AC 42 ms
56,128 KB
testcase_07 AC 42 ms
56,128 KB
testcase_08 AC 41 ms
56,128 KB
testcase_09 AC 42 ms
56,128 KB
testcase_10 AC 109 ms
107,164 KB
testcase_11 AC 105 ms
107,172 KB
testcase_12 AC 96 ms
106,792 KB
testcase_13 AC 66 ms
83,124 KB
testcase_14 AC 55 ms
72,928 KB
testcase_15 AC 83 ms
96,780 KB
testcase_16 AC 91 ms
99,700 KB
testcase_17 AC 79 ms
91,564 KB
testcase_18 AC 61 ms
76,424 KB
testcase_19 AC 63 ms
79,088 KB
testcase_20 AC 86 ms
97,688 KB
testcase_21 AC 74 ms
87,540 KB
testcase_22 AC 73 ms
88,880 KB
testcase_23 AC 66 ms
82,928 KB
testcase_24 AC 85 ms
96,048 KB
testcase_25 AC 84 ms
94,480 KB
testcase_26 AC 62 ms
79,964 KB
testcase_27 AC 58 ms
73,996 KB
testcase_28 AC 61 ms
80,316 KB
testcase_29 AC 53 ms
68,068 KB
testcase_30 AC 73 ms
87,996 KB
testcase_31 AC 93 ms
103,872 KB
testcase_32 AC 59 ms
74,548 KB
testcase_33 AC 76 ms
89,708 KB
testcase_34 AC 79 ms
93,760 KB
testcase_35 AC 51 ms
67,224 KB
testcase_36 AC 86 ms
96,268 KB
testcase_37 AC 91 ms
100,696 KB
testcase_38 AC 62 ms
81,280 KB
testcase_39 AC 93 ms
103,372 KB
testcase_40 AC 75 ms
88,268 KB
testcase_41 AC 81 ms
94,084 KB
testcase_42 AC 80 ms
93,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, random
input = lambda : sys.stdin.readline().rstrip()


write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18
LI = lambda : list(map(int, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()]
def debug(_l_):
    for s in _l_.split():
        print(f"{s}={eval(s)}", end=" ")
    print()
def dlist(*l, fill=0):
    if len(l)==1:
        return [fill]*l[0]
    ll = l[1:]
    return [dlist(*ll, fill=fill) for _ in range(l[0])]

n,m = list(map(int, input().split()))
s = input()
ss = "WAC"
dd = {c:i for i,c in enumerate(ss)}
s = [dd[c] for c in s]
index = [[] for _ in range(3)]
for i in range(len(s)):
    c = s[i]
    index[c].append(i)
ng = 0
l0 = index[0]
l1 = index[1][m:]
l2 = index[1][:m]
l3 = index[2]
pans(all((l0[i]<l1[i] for i in range(n))) and all((l2[i]<l3[i] for i in range(m))))
0