結果

問題 No.2240 WAC
ユーザー 👑 timitimi
提出日時 2023-03-10 21:33:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,692 KB
実行使用メモリ 93,948 KB
最終ジャッジ日時 2023-10-18 07:15:17
合計ジャッジ時間 3,997 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,140 KB
testcase_01 AC 38 ms
53,140 KB
testcase_02 AC 38 ms
53,140 KB
testcase_03 AC 37 ms
53,140 KB
testcase_04 AC 39 ms
53,140 KB
testcase_05 AC 38 ms
53,140 KB
testcase_06 AC 38 ms
53,140 KB
testcase_07 AC 38 ms
53,140 KB
testcase_08 AC 38 ms
53,140 KB
testcase_09 AC 38 ms
53,140 KB
testcase_10 AC 78 ms
93,948 KB
testcase_11 AC 74 ms
93,940 KB
testcase_12 AC 75 ms
93,944 KB
testcase_13 AC 57 ms
73,228 KB
testcase_14 AC 49 ms
65,148 KB
testcase_15 AC 68 ms
84,504 KB
testcase_16 AC 69 ms
86,980 KB
testcase_17 AC 64 ms
79,748 KB
testcase_18 AC 52 ms
66,416 KB
testcase_19 AC 54 ms
68,912 KB
testcase_20 AC 70 ms
85,260 KB
testcase_21 AC 58 ms
73,668 KB
testcase_22 AC 61 ms
75,308 KB
testcase_23 AC 57 ms
71,656 KB
testcase_24 AC 68 ms
83,804 KB
testcase_25 AC 67 ms
82,068 KB
testcase_26 AC 55 ms
69,764 KB
testcase_27 AC 52 ms
68,124 KB
testcase_28 AC 56 ms
71,696 KB
testcase_29 AC 49 ms
64,512 KB
testcase_30 AC 59 ms
76,356 KB
testcase_31 AC 75 ms
91,028 KB
testcase_32 AC 52 ms
66,640 KB
testcase_33 AC 62 ms
77,984 KB
testcase_34 AC 64 ms
81,620 KB
testcase_35 AC 49 ms
63,744 KB
testcase_36 AC 68 ms
83,852 KB
testcase_37 AC 73 ms
88,068 KB
testcase_38 AC 56 ms
70,328 KB
testcase_39 AC 75 ms
90,572 KB
testcase_40 AC 62 ms
76,564 KB
testcase_41 AC 66 ms
81,880 KB
testcase_42 AC 65 ms
81,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
S=input()
W,A,C=[],[],[]
for i in range(len(S)):
  if S[i]=='W':
    W.append(i)
  elif S[i]=='A':
    A.append(i)
  else:
    C.append(i)

AW,AC=A[-len(W):],A[:len(C)]
f=0
for i in range(len(W)):
  if W[i]>AW[i]:
    f=1 
for i in range(len(C)):
  if A[i]>C[i]:
    f=1
if f==0:
  print('Yes')
else:
  print('No')
0