結果
問題 |
No.2240 WAC
|
ユーザー |
![]() |
提出日時 | 2023-04-28 12:10:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 70 ms / 2,000 ms |
コード長 | 405 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 76,244 KB |
最終ジャッジ日時 | 2024-11-17 13:10:08 |
合計ジャッジ時間 | 4,321 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 |
ソースコード
N,M = map(int,input().split()) S = input() NS = len(S) a,w,c = 0,0,0 for i in range(NS): s = S[i] if s == "A": a += 1 elif s == "C": c += 1 if a < c: print("No") exit() a,w,c = 0,0,0 for i in reversed(range(NS)): s = S[i] if s == "A": a += 1 elif s == "W": w += 1 if a < w: print("No") exit() print("Yes")