結果
問題 |
No.2076 Concon Substrings (ConVersion)
|
ユーザー |
![]() |
提出日時 | 2025-04-15 21:22:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 755 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 65,144 KB |
最終ジャッジ日時 | 2025-04-15 21:28:32 |
合計ジャッジ時間 | 2,696 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)