結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-07 01:29:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 760 ms / 5,000 ms |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 85,192 KB |
| 実行使用メモリ | 96,872 KB |
| 最終ジャッジ日時 | 2026-03-09 07:24:27 |
| 合計ジャッジ時間 | 7,723 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from heapq import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ret = n
for i in range(n):
pq = [(x, 0) for x in a]
heapify(pq)
mx = 0
for j in range(n):
e = b[(i + j) % n]
u = heappop(pq)
u = (u[0] + e // 2, u[1] + 1)
heappush(pq, u)
mx = max([e[1] for e in pq])
ret = min(ret, mx)
print(ret)