結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2023-03-06 00:42:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 602 bytes |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 65,920 KB |
| 最終ジャッジ日時 | 2024-09-18 01:46:10 |
| 合計ジャッジ時間 | 3,730 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 WA * 12 |
ソースコード
n, m = map(int,input().split())
s = input()
assert 1 <= n <= 10 ** 5
assert 1 <= m <= 10 ** 5
w = s.count("W")
a = s.count("A")
c = s.count("C")
assert w == n
assert a == n + m
assert c == m
assert len(s) == 2*(n+m)
pivot = 0
for i in range(2*(n+m)):
if s[i] == "C":
mode = 0
while pivot < i and mode == 0:
if s[pivot] == "A":
mode = 1
pivot += 1
if mode == 0:
print("No")
exit()
for i in range(2*(n+m)):
if s[i] == "W":
mode = 0
while pivot < 2*(n+m) and mode == 0:
if s[pivot] == "A":
mode = 1
pivot += 1
if mode == 0:
print("No")
exit()
print("Yes")
shobonvip