結果
問題 | No.2076 Concon Substrings (ConVersion) |
ユーザー |
![]() |
提出日時 | 2025-04-16 15:36:07 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 755 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 81,536 KB |
実行使用メモリ | 63,360 KB |
最終ジャッジ日時 | 2025-04-16 15:41:07 |
合計ジャッジ時間 | 2,565 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 WA * 8 |
ソースコード
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) steps = 0 current_step = 1 while True: k = A if current_step % 2 == 1 else B found = False for i in range(len(runs)): if runs[i] >= k: runs[i] -= k if runs[i] == 0: del runs[i] steps += 1 current_step += 1 found = True break if not found: break print(steps)