結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2024-10-20 14:34:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 3,904 ms / 5,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 500 ms |
コンパイル使用メモリ | 82,132 KB |
実行使用メモリ | 102,640 KB |
最終ジャッジ日時 | 2024-10-20 14:35:14 |
合計ジャッジ時間 | 33,072 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) from heapq import heappush,heappop def solve(a,b): q=[(v,0) for v in a] q.sort() for u in b: v,c=heappop(q) v+=u//2 c+=1 heappush(q,(v,c)) q=list(q) return max(c for v,c in q) ans=10**10 for i in range(n): ans=min(ans,solve(a,b[i:]+b[:i])) print(ans)