結果
| 問題 |
No.2076 Concon Substrings (ConVersion)
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 21:10:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 665 bytes |
| コンパイル時間 | 149 ms |
| コンパイル使用メモリ | 82,128 KB |
| 実行使用メモリ | 63,160 KB |
| 最終ジャッジ日時 | 2025-04-15 21:16:06 |
| 合計ジャッジ時間 | 2,228 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 WA * 19 |
ソースコード
n, A, B = map(int, input().split())
s = input().strip()
runs = []
current_run = 0
i = 0
while i <= len(s) - 3:
if s[i] == 'c' and s[i+1] == 'o' and s[i+2] == 'n':
current_run += 1
i += 3
else:
if current_run > 0:
runs.append(current_run)
current_run = 0
i += 1
if current_run > 0:
runs.append(current_run)
total_steps = 0
for m in runs:
current = m
steps = 0
turn = A
while True:
if current >= turn:
steps += 1
current -= turn
turn = B if turn == A else A
else:
break
total_steps += steps
print(total_steps)
lam6er