Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
# osoi
As = sorted([-a for a in As])
while M:
    hoge = -As.pop(0) // 2
    M -= 1
    while M and As and hoge < As[1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, -hoge)
print(-sum(As))


Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
# osoi
As = sorted([-a for a in As])
while M:
    hoge = -As.pop(0) // 2
    M -= 1
    while M and As and hoge < As[1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, -hoge)
print(-sum(As))


Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
As = sorted([-a for a in As])
for i in range(M):
    hoge = -As.pop(0) // 2
    bisect.insort(As, -hoge)
print(-sum(As))


Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
#  sortしていちばん大きいのをとって半額にしてAsに戻してもう一回ソートするのをM回やれば1e5 にN log N +alpha
As = sorted(As)
while M:
    hoge = As.pop(-1) // 2
    M -= 1
    while M and As and hoge >= As[-1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, hoge)
print(sum(As))

Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
#  sortしていちばん大きいのをとって半額にしてAsに戻してもう一回ソートするのをM回やれば1e5 にN log N +alpha
As = sorted(As)
while M:
    hoge = As.pop(-1) // 2
    M -= 1
    while M and As and hoge >= As[-1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, hoge)
print(sum(As))

Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
As = sorted(As)
trimeed = len(As) - 1
for i in range(M):
    hoge = As.pop(-1) // 2
    while As and not As[0]:
        As.pop(0)
    bisect.insort(As, hoge)
print(sum(As))

Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
#  sortしていちばん大きいのをとって半額にしてAsに戻してもう一回ソートするのをM回やれば1e5 にN log N +alpha
As = sorted(As)
trimeed = len(As) - 1
for i in range(M):
    hoge = As[-1] // 2
    As = As[:-1]
    t=bisect.insort(As, hoge)
print(sum(As))

Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
#  sortしていちばん大きいのをとって半額にしてAsに戻してもう一回ソートするのをM回やれば1e5 にN log N +alpha
As = sorted(As)
trimeed = len(As) - 1
for i in range(M):
    hoge = As[-1] // 2
    As = As[:-1]
    t=bisect.insort(As, hoge)
print(sum(As))

Fixed submission:
import math
import heapq
n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = [-a for a in aaa]
heapq.heapify(aaa)
for i in range(k):  # TLE?
    t = heapq.heappop(aaa)
    t = math.ceil(t/2)
    heapq.heappush(aaa, t)
print(-sum(aaa))