题解 | 小苯的比赛上分
小苯的比赛上分
https://www.nowcoder.com/practice/f5c52183dfb148489321f881239216c1
import heapq
m,n=input().split()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
heapq.heapify(a)
maxscore=max(a)
for i in b:
minscore=heapq.heappop(a)
minscore+=i
heapq.heappush(a,minscore)
maxscore=max(maxscore,minscore)
print(maxscore)

查看19道真题和解析