結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2023-03-10 23:11:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 99 ms / 2,000 ms |
| コード長 | 440 bytes |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 82,508 KB |
| 実行使用メモリ | 108,616 KB |
| 最終ジャッジ日時 | 2024-09-18 05:21:13 |
| 合計ジャッジ時間 | 4,436 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
import collections
N,M = map(int, input().split())
S = list(input())
A = collections.deque()
W = []
C = []
for i,s in enumerate(S):
if s=='A':
A.append(i)
if s=='W':
W.append(i)
if s=='C':
C.append(i)
for w in W[::-1]:
if w<A[-1]:
A.pop()
else:
print('No')
exit()
for c in C:
if A[0]<c:
A.popleft()
else:
print('No')
exit()
print('Yes')
H20