結果
| 問題 |
No.2076 Concon Substrings (ConVersion)
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 21:28:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 840 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 82,044 KB |
| 実行使用メモリ | 64,644 KB |
| 最終ジャッジ日時 | 2025-04-15 21:31:38 |
| 合計ジャッジ時間 | 2,539 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 WA * 19 |
ソースコード
n, A, B = map(int, input().split())
s = input().strip()
runs = []
i = 0
while i <= len(s) - 3:
if s[i:i+3] == 'con':
count = 1
i += 3
while i <= len(s) - 3 and s[i:i+3] == 'con':
count += 1
i += 3
runs.append(count)
else:
i += 1
total = 0
for l in runs:
steps = 0
current_parity = 1 # 1 for A's turn, 0 for B's turn
remaining = l
while True:
if current_parity == 1:
if remaining >= A:
steps += 1
remaining -= A
current_parity = 0
else:
break
else:
if remaining >= B:
steps += 1
remaining -= B
current_parity = 1
else:
break
total += steps
print(total)
lam6er