py选手分享一下,测试用例都过了。。。 第一题:优先队列(堆),每次只对堆顶进行操作: def solution1(A: list)-> int: target = sum(A)/2 n = len(A) pq = PriorityQueue(n) for it in A: pq.put(-it) ans = 0 tmp = 0 while tmp<target: cur = pq.get()/2 tmp -= cur pq.put(cur) ...