結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2015-10-08 23:05:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 342 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-07-20 02:18:56 |
合計ジャッジ時間 | 36,800 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 4 |
ソースコード
# coding: utf-8 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 = Aheap[:] ansc = 0 for j in B[i:i+N]: lv, c = a[0] heapq.heapreplace(a, (lv+j, c+1)) ansc = max(ansc, c+1) ans=min(ans, ansc) print(ans)