結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
matsu7874
|
| 提出日時 | 2015-08-16 22:45:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 4,070 ms / 5,000 ms |
| コード長 | 402 bytes |
| コンパイル時間 | 107 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-06-23 22:55:52 |
| 合計ジャッジ時間 | 33,871 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import heapq
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
H = [(A[i],0) for i in range(N)]
heapq.heapify(H)
min_max_cnt = N
for i in range(N):
h = H[:]
for j in range(N):
t = heapq.heappop(h)
cnt = t[1]+1
heapq.heappush(h, (B[j-i]//2+t[0], cnt))
min_max_cnt = min(min_max_cnt, max(t[1] for t in h))
print(min_max_cnt)
matsu7874