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

N,M = list(map(int,input().split()))
A = [int(i) for i in input().split()]

A *= -1

heapq.heapify(A)

for i in range(M):
  tmp = heapq.heappop(A) * (-1)
  heapq.heappush(A, -(tmp // 2))

print(-sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Runtime Error):
from numpy import array, sum, argmax
import heapq

N,M = list(map(int,input().split()))
A = [int(i) for i in input().split()]

A *= -1

heapq.heapify(A)

for i in range(M):
  tmp = heapq.heappop(A) * (-1)
  heapq.heappush(A, -(tmp // 2))

print(-sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
from numpy import array, sum, argmax

N,M = list(map(int,input().split()))
A = array([int(i) for i in input().split()])

for i in range(M):
  #print(A)
  idx = argmax(A)
  A[idx] >>= 1

print(sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
from numpy import array, sum, argmax

N,M = list(map(int,input().split()))
A = array([int(i) for i in input().split()])

for i in range(M):
  #print(A)
  idx = argmax(A)
  A[idx] //= 2

print(sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,M = list(map(int,input().split()))
A = np.array([int(i) for i in input().split()])

for i in range(M):
  #print(A)
  idx = np.argmax(A)
  A[idx] //= 2

print(np.sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = list(map(int,input().split()))
A = [int(i) for i in input().split()]

for i in range(M):
  #print(A)
  idx = A.index(max(set(A)))
  A[idx] = A[idx] // 2

print(sum(A))


Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = list(map(int,input().split()))
A = [int(i) for i in input().split()]

for i in range(M):
  #print(A)
  idx = A.index(max(A))
  A[idx] = A[idx] // 2

print(sum(A))

Fixed submission:
import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))