結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-30 19:42:47 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 798 ms / 5,000 ms |
| + 450µs | |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 81,408 KB |
| 実行使用メモリ | 90,716 KB |
| 最終ジャッジ日時 | 2026-07-17 08:50:21 |
| 合計ジャッジ時間 | 9,658 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import heapq
n=input()
a=map(int,raw_input().split())+[1e9]
heapq.heapify(a)
a=[(i,0) for i in a]
b=[int(i)/2 for i in raw_input().split()]
def check(i):
pq=a[:]
for elevel in b[i:]+b[:i]:
level,cnt=heapq.heappop(pq)
heapq.heappush(pq,(level+elevel,cnt+1))
return max(y for x,y in pq)
print(min(check(i) for i in range(n)))