結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
|
| 提出日時 | 2021-04-12 21:40:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,177 ms / 5,000 ms |
| コード長 | 395 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 82,268 KB |
| 実行使用メモリ | 88,496 KB |
| 最終ジャッジ日時 | 2024-06-28 17:19:59 |
| 合計ジャッジ時間 | 12,022 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from heapq import heappush, heappop, heapify
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 10**10
base = [(a,0) for a in A]
for i in range(n):
h = base.copy()
heapify(h)
for j in range(n):
a,num = heappop(h)
a += B[(i+j)%n]//2
heappush(h, (a,num+1))
m = max(i for _,i in h)
ans = min(ans,m)
print(ans)