結果
問題 | No.9 モンスターのレベル上げ |
ユーザー |
|
提出日時 | 2020-09-25 16:52:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 4,959 ms / 5,000 ms |
コード長 | 566 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-06-28 05:50:46 |
合計ジャッジ時間 | 42,480 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import heapq N = int(input()) parties = list(map(int, input().split())) monsters = list(map(int, input().split())) monsters = monsters + monsters result = N for i in range(N): k = i battles = [(x, 0) for x in parties] heapq.heapify(battles) for j in range(N): idx = battles[0] heapq.heappushpop(battles, (idx[0] + monsters[k] // 2, idx[1] + 1)) k += 1 if k >= N: k = 0 maximum = 0 for battle in battles: maximum = max(maximum, battle[1]) result = min(result, maximum) print(result)