結果
問題 | No.9 モンスターのレベル上げ |
ユーザー |
![]() |
提出日時 | 2015-10-08 22:32:52 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 4,721 ms / 5,000 ms |
コード長 | 450 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 7,040 KB |
最終ジャッジ日時 | 2024-06-23 23:08:15 |
合計ジャッジ時間 | 35,764 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
# coding: utf-8 import heapq N = int(raw_input()) A = map(int, raw_input().split()) B = map(int, raw_input().split()) Aheap = [] for i in range(len(A)): heapq.heappush(Aheap, (A[i], 0)) B = [b/2 for b in B] ans = int(1e9+7) for i in range(len(B)): a = list(Aheap) for j in range(len(B)): lv, c = a[0] #print str(lv) + ' ' + str(c) heapq.heapreplace(a, (lv+B[(i+j)%len(B)], c+1)) #print a ans=min(ans, max(c for lv, c in a)) print ans