結果
問題 |
No.2240 WAC
|
ユーザー |
|
提出日時 | 2023-03-18 14:58:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 81,840 KB |
実行使用メモリ | 75,776 KB |
最終ジャッジ日時 | 2024-09-18 13:18:11 |
合計ジャッジ時間 | 4,209 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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')