結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2015-10-08 23:18:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 3,405 ms / 5,000 ms |
コード長 | 333 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-06-23 23:12:03 |
合計ジャッジ時間 | 27,080 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import heapq N = int(input()) A = list(map(int, input().split())) B = [int(x)//2 for x in input().split()] * 2 A.sort() Aheap = [(a, 0) for a in A] ans = N for i in range(N): a = list(Aheap) for j in B[i:i+N]: lv, c = a[0] heapq.heapreplace(a, (lv+j, c+1)) ansc=max(c for lv, c in a) if ans > ansc: ans = ansc print(ans)