結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-18 14:59:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 2,000 ms |
| コード長 | 384 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 82,568 KB |
| 実行使用メモリ | 75,988 KB |
| 最終ジャッジ日時 | 2024-09-18 13:18:19 |
| 合計ジャッジ時間 | 3,605 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
N,M = map(int,input().split())
S = input()
import sys
a = 0
for s in S:
if s == "A":
a += 1
elif s == "C":
if a == 0:
print('No')
exit()
else:
a -= 1
a = 0
for s in reversed(S):
if s == "A":a += 1
elif s == "W":
if a == 0:
print('No')
exit()
else:a -= 1
print('Yes')