結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
|
提出日時 | 2019-10-23 22:17:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 845 ms / 5,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 81,964 KB |
実行使用メモリ | 87,320 KB |
最終ジャッジ日時 | 2024-07-07 05:11:59 |
合計ジャッジ時間 | 9,253 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
from heapq import heapify, heappop, heappush N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) myMonster = [(a, 0) for a in A] heapify(myMonster) ans = float('inf') for start in range(N): A = myMonster[:] for b in B[start:] + B[:start]: now, time = heappop(A) now += b // 2 heappush(A, (now, time + 1)) ans = min(ans, max([a for _, a in A])) print(ans)