結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2025-04-16 15:38:28 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 922 bytes |
コンパイル時間 | 349 ms |
コンパイル使用メモリ | 81,724 KB |
実行使用メモリ | 86,268 KB |
最終ジャッジ日時 | 2025-04-16 15:43:46 |
合計ジャッジ時間 | 6,972 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 17 |
ソースコード
n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) min_result = float('inf') for start in range(n): current_A = A.copy() used = [False] * n count = [0] * n for i in range(n): enemy_idx = (start + i) % n enemy_level = B[enemy_idx] min_level = min(current_A) candidates = [] available = [] for j in range(n): if current_A[j] == min_level: candidates.append(j) if not used[j]: available.append(j) if available: chosen = min(available) else: chosen = min(candidates) count[chosen] += 1 current_A[chosen] += enemy_level // 2 used[chosen] = True current_max = max(count) if current_max < min_result: min_result = current_max print(min_result)