結果
| 問題 | No.2240 WAC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-18 14:58:01 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 384 bytes |
| 記録 | |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 96,372 KB |
| 実行使用メモリ | 84,224 KB |
| 最終ジャッジ日時 | 2026-08-30 05:58:49 |
| 合計ジャッジ時間 | 5,340 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 27 |
ソースコード
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
w = 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')