Buggy python submission (verdict: Runtime Error):
import heapq
 
itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))
 
h = []
for price in prices:
    heapq._heappush_max(h, price)
 
for i in range(ticketCount):
    price = _heappop_max(h)
    heapq._heappush_max(h, price // 2)
total = 0
for price in h:
    total += price
 
print(total)

Fixed submission:
import heapq


def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)


def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt


itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))

h = []
for price in prices:
    _heappush_max(h, price)

for i in range(ticketCount):
    price = _heappop_max(h)
    _heappush_max(h, price // 2)
total = 0
for price in h:
    total += price

print(total)

Buggy python submission (verdict: Runtime Error):
import heapq


def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)


def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt


itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))

h = []
for price in prices:
    _heappush_max(h, price)

for i in range(ticketCount):
    price = _heappop_max(h)
    _heappush_max(h, price // 2)
total = 0
for price in h:
    total += price

print(total)

Fixed submission:
import heapq


def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)


def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt


itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))

h = []
for price in prices:
    _heappush_max(h, price)

for i in range(ticketCount):
    price = _heappop_max(h)
    _heappush_max(h, price // 2)
total = 0
for price in h:
    total += price

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))


class Product:
    def __init__(self, price):
        self.price = price
        self.ticket = 0
        self.pay = price

    def getPay(self):
        return self.pay // 2 ** self.ticket


def highestProductIndex(products):
    highPrice = 0
    highPriceIndex = 0
    for index, product in enumerate(products):
        if highPrice < product.getPay():
            highPrice = product.getPay()
            highPriceIndex = index

    return highPriceIndex


products = []
for price in prices:
    products.append(Product(price))

for tickenNumber in range(ticketCount):
    index = highestProductIndex(products)
    products[index].ticket += 1

total = 0
for product in products:
    total += product.getPay()

print(total)

Fixed submission:
import heapq


def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)


def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt


itemCount, ticketCount = map(int, input().split(' '))
prices = map(int, input().split(' '))

h = []
for price in prices:
    _heappush_max(h, price)

for i in range(ticketCount):
    price = _heappop_max(h)
    _heappush_max(h, price // 2)
total = 0
for price in h:
    total += price

print(total)