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

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(M):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

if N == 1:
    for i in range(M):
        a //= 2
    print(a[0])
    exit()

a.sort()
cur = M - 1
for i in range(M):
    if i == 0:
        a[-1] //= 2
    else:
        if (a[cur-1] > a[cur]):
            cur -= 1
            a[a[cur:].argmax()+cur] //= 2
        else:
            if cur == M-1:
                a[-1] //= 2
            else:
                a[a[cur:].argmax()+cur] //= 2
print(sum(a))


Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

if N == 1:
    for i in range(M):
        a //= 2
    print(a[0])
    exit()

a.sort()
cur = M - 1
for i in range(M):
    if i == 0:
        a[-1] //= 2
    else:
        if (a[cur-1] > a[cur]):
            cur -= 1
            a[a[cur:].argmax()+cur] //= 2
        else:
            a[-1] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

if N == 1:
    for i in range(M):
        a //= 2
    print(a[0])
    exit()

a.sort()
cur = M - 1
for i in range(M):
    if i == 0:
        a[-1] //= 2
    else:
        if (a[cur-1] > a[cur]):
            cur -= 1
            a[a[cur:].argmax()] //= 2
        else:
            a[-1] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

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

N, M = map(int, input().split())
# a = np.array(list(map(int, input().split())))
a = list(map(int, input().split()))

for _ in range(M):
    # a[a.argmax()] //= 2
    a.sort()
    a[-1] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

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

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

for _ in range(M):
    a[a.argmax()] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

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

N, M = map(int, input().split())
a = numpy.array(list(map(int, input().split())))

for i in range(M):
    # j = max(enumerate(a), key=lambda x: x[1])[0]
    j = a.argmax()
    a[j] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Buggy python submission (verdict: Time Limit Exceeded):
import math

N, M = map(int, input().split())
a = list(map(int, input().split()))

for i in range(M):
    j = max(enumerate(a), key=lambda x: x[1])[0]
    a[j] //= 2
print(sum(a))

Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))

Buggy python submission (verdict: Time Limit Exceeded):
import math

N, M = map(int, input().split())
a = list(map(int, input().split()))

for i in range(M):
    j = max(enumerate(a), key=lambda x: x[1])[0]
    a[j] /= 2
for i in range(N):
    a[i] = math.floor(a[i])
print(sum(a))


Fixed submission:
import heapq

N, M = map(int, input().split())
a = list(map(int, input().split()))

q = []
for i in range(N):
    # 最も大きい値を取り出して1/2したいので、ここで反転させておき、最終的に足す時に戻す
    heapq.heappush(q, -a[i])
for i in range(M):
    l = heapq.heappop(q)
    heapq.heappush(q, -(-l//2))
print(-sum(q))