結果
問題 | No.2240 WAC |
ユーザー | lloyz |
提出日時 | 2023-03-10 23:23:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 643 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 95,616 KB |
最終ジャッジ日時 | 2024-09-18 05:38:52 |
合計ジャッジ時間 | 7,215 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 |
ソースコード
from collections import deque n, m = map(int, input().split()) S = list(input()) A = deque() W = deque() for i in range(2 * (n + m)): if S[i] == 'A': A.append(i) elif S[i] == 'C': if len(A) > 0: A.popleft() else: print("No") exit() else: W.append(i) for i in range(n): if A[i] < W[i]: print("No") exit() print("Yes")