結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-10-20 14:34:40 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2,543 ms / 5,000 ms |
| + 183µs | |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 81,280 KB |
| 実行使用メモリ | 105,124 KB |
| 最終ジャッジ日時 | 2026-09-19 02:50:07 |
| 合計ジャッジ時間 | 22,801 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
sasa8uyauya