Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
n = int(input())
a_b = sorted(make_divisors(n))
flag = False
for i in a_b:
  if i ** 5 == n:
    print(i, 0)
    break
  else:
    for b in range(-1*i-1, i + 1):
      if (i+b)**5-b**5 == n:
        print(i + b, b)
        flag = True
        break
  if flag:
    break

Fixed submission:
import numpy as np
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            #if i != n // i:
                #divisors.append(n//i)
    return divisors
n = int(input())
a_b = sorted(make_divisors(n))
flag = False
for i in a_b:
  if i ** 5 == n:
    print(i, 0)
    break
  else:
    for b in range(-int(np.sqrt(n)), int(np.sqrt(n + 1))):
      if (i+b)**5-b**5 == n:
        print(i + b, b)
        flag = True
        break
  if flag:
    break

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
n = int(input())
a_b = make_divisors(n)
flag = False
for i in a_b:
  if i ** 5 == n:
    print(i, 0)
    break
  else:
    for b in range(-1*i-1, i + 1):
      if (i+b)**5-b**5 == n:
        print(i + b, b)
        flag = True
        break
  if flag:
    break

Fixed submission:
import numpy as np
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            #if i != n // i:
                #divisors.append(n//i)
    return divisors
n = int(input())
a_b = sorted(make_divisors(n))
flag = False
for i in a_b:
  if i ** 5 == n:
    print(i, 0)
    break
  else:
    for b in range(-int(np.sqrt(n)), int(np.sqrt(n + 1))):
      if (i+b)**5-b**5 == n:
        print(i + b, b)
        flag = True
        break
  if flag:
    break
Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
mod = [0]*2019
mod[0] += 1#右端から見たときに2019の倍数がある場合に対応
for i in range(len(s)-1, -1, -1):
  mod[int(s[i:])%2019] += 1
ans =  0
for i in mod:
  ans += i*(i-1)//2
print(ans)

Fixed submission:
s = str(input())
p = 2019
mod = [0]*2019
mod[0] += 1#右端から見たときに2019の倍数がある場合に対応
now = 0
_10 = 1
for i in range(len(s)-1, -1, -1):
  now = (now + int(s[i])*_10) % p
  _10 *= 10
  _10 %= p
  mod[now] += 1
ans =  0
for i in mod:
  ans += i*(i-1)//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a  = list(map(int, input().split()))
import numpy  as np
a = np.array(a)
for i in range(1, n+1):
  print(np.count_nonzero(a == i))

Fixed submission:
n = int(input())
a  = list(map(int, input().split()))
import numpy  as np
a = np.array(a)
ans = np.zeros(n)
for i in a:
  ans[i-1] += 1
for i in ans:
  print(int(i))
Buggy python submission (verdict: Runtime Error):
k = int(input())
def dfs(s):
  if len(s)<10:
    for i in range(-1, 2, 1):
      s+str(min(9, max(0, int(s[-1])+i)))
      return dfs(s)
  else:
    return s
S = []
for i in range(10):
  S.append(dfs(str(i)))
  

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

k = int(input())
S = []
def dfs(s):
  if len(s)<10:
    for i in range(-1, 2, 1):
      a = str(min(9, max(0, int(s[0])+i)))+s
      S.append(a)
      dfs(a)

for i in range(10):
  S.append(i)
  dfs(str(i))
S = sorted(set([int(s) for s in S]))
print(S[k])
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A = sorted(A)
B = sorted(B)

A = A[len(A)-x:]
B = B[len(B)-y:]
C = list(map(lambda x: x*(-1), C))

import heapq
heapq.heapify(A)
heapq.heapify(B)
heapq.heapify(C)

flag = True
while flag:
  a = heapq.heappop(A)
  b = heapq.heappop(B)
  c = heapq.heappop(C)*(-1)
  if c < a and c < b:
    flag = False
  else:
    if a-c > b-c:
      heapq.heappush(A, c)
      heapq.heappush(B, b)
      if not C:
        break
    else:
      heapq.heappush(A, a)
      heapq.heappush(B, c)
      if not C:
        break
print(sum(A) + sum())

Fixed submission:
x, y, a, b, c = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A = sorted(A)
B = sorted(B)

A = A[len(A)-x:]
B = B[len(B)-y:]
C = list(map(lambda x: x*(-1), C))

import heapq
heapq.heapify(A)
heapq.heapify(B)
heapq.heapify(C)

flag = True
while flag:
  a = heapq.heappop(A)
  b = heapq.heappop(B)
  c = heapq.heappop(C)*(-1)
  if c < a and c < b:
    heapq.heappush(A, a)
    heapq.heappush(B, b)
    flag = False
  else:
    if a > b:
      heapq.heappush(A, a)
      heapq.heappush(B, c)
      if not C:
        break
    else:
      heapq.heappush(A, c)
      heapq.heappush(B, b)
      if not C:
        break
print(sum(A) + sum(B))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
frac = [1]
for i in range(max(n, m)):
    frac.append(frac[i]*(i+1)%p)
mod = 10**9 + 7
#フェルマーの小定理を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
print(comb(n, 2, mod) + comb(m, 2, mod))

Fixed submission:
n, m = map(int, input().split())
frac = [1]
p = 10**9 + 7
for i in range(max(n, m)):
    frac.append(frac[i]*(i+1)%p)

#フェルマーの小定理を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
if n >= 2:
  a = comb(n, 2, p)
else:
  a = 0
if m >= 2:
  b = comb(m, 2, p)
else:
  b = 0
print(a + b)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
frac = [1]
for i in range(max(n, m)):
    frac.append(frac[i]*(i+1)%p)
mod = 10***9 + 7
#フェルマーの小定理を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
print(comb(n, 2, mod) + comb(m, 2, mod))

Fixed submission:
n, m = map(int, input().split())
frac = [1]
p = 10**9 + 7
for i in range(max(n, m)):
    frac.append(frac[i]*(i+1)%p)

#フェルマーの小定理を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
if n >= 2:
  a = comb(n, 2, p)
else:
  a = 0
if m >= 2:
  b = comb(m, 2, p)
else:
  b = 0
print(a + b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
num = [0]*n
for i in A:
  num[i-1] += 1
frac = [1]
for i in range(max(num)):
    frac.append(frac[i]*(i+1))
def comb(n, k):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a // (b * c))
ans_sub = 0
for i in num:
  if i < 2:
    pass
  else:
    ans_sub += comb(i, 2)
for i in A:
  if num[i-1] < 2:
    a = 0
  else:
    a = num[i-1]-1
  print(ans_sub-a)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
num = [0]*n
for i in A:
  num[i-1] += 1
def comb(n):
    if n < 2:
      return 0
    else:
      return n * (n-1) // 2
ans_sub = 0
for i in num:
  ans_sub += comb(i)
for i in A:
  if num[i-1] < 2:
    a = 0
  else:
    a = num[i-1]-1
  print(ans_sub-a)
Buggy python submission (verdict: Time Limit Exceeded):
S = list(str(input()))
Q = int(input())
num_rev = 0
for i in range(Q):
  a = list(map(str, input().split()))
  if len(a) == 1:
    num_rev += 1
  else:
    if num_rev % 2 == 0:
      if a[1] == "1":
        S.insert(0, a[2])
      else:
        S.append(a[2])
    else:
      if a[1] == "1":
        S.append(a[2])
      else:
        S.insert(0, a[2])
if num_rev % 2 == 1:
  S = list(reversed(S))
print(''.join(S))

Fixed submission:
S = list(str(input()))
Q = int(input())
s1 = []#先頭
s2 = []#後方
b = []
num_rev = 0
for i in range(Q):
  a = list(map(str, input().split()))
  if len(a) == 1:
    num_rev += 1
  else:
    if (num_rev + int(a[1]))%2==0:
      s2.append(a[2])
    else:
      s1.append(a[2])
if num_rev % 2 == 0:
  s1 = list(reversed(s1))
  s1.extend(S)
  s1.extend(s2)
  print(''.join(s1))
else:
  s2 = list(reversed(s2))
  s2.extend(list(reversed(S)))
  s2.extend(s1)
  print(''.join(s2))

Buggy python submission (verdict: Time Limit Exceeded):
S = list(str(input()))
Q = int(input())
for i in range(Q):
  a = list(map(str, input().split()))
  if len(a) == 1:
    S = list(reversed(S))
  else:
    if a[1] == "1":
      S.insert(0, a[2])
    else:
      S.append(a[2])
print(''.join(S))

Fixed submission:
S = list(str(input()))
Q = int(input())
s1 = []#先頭
s2 = []#後方
b = []
num_rev = 0
for i in range(Q):
  a = list(map(str, input().split()))
  if len(a) == 1:
    num_rev += 1
  else:
    if (num_rev + int(a[1]))%2==0:
      s2.append(a[2])
    else:
      s1.append(a[2])
if num_rev % 2 == 0:
  s1 = list(reversed(s1))
  s1.extend(S)
  s1.extend(s2)
  print(''.join(s1))
else:
  s2 = list(reversed(s2))
  s2.extend(list(reversed(S)))
  s2.extend(s1)
  print(''.join(s2))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [[] for _ in range(N)]
for i in range(M):
  s, c = map(int, input().split())
  a[s-1].append(c)
flag = 0
ans = [0]*N
for i in range(len(a)):
  if len(set(a[i]))>1:
    flag = 1
    break
  elif a[i]:
    ans[i] = a[i][0]
if a[0][0] == 0:
  flag = 1
ans = ''.join((str(n) for n in ans))
if flag == 0:
  if a[0] == 0:
    a[0] = 1
  ans = ''.join((str(n) for n in ans))
  print(int(ans))
else:
  print(-1)

Fixed submission:
N, M = map(int, input().split())
a = [[] for _ in range(N)]
flag = 0
for i in range(M):
  s, c = map(int, input().split())
  a[s-1].append(c)
ans = [0]*N
 
for i in range(len(a)): 
  if i == 0 and a[i]:
    if len(a) == 1:
      pass
    elif len(set(a[i]))> 1 or 0 in a[i]:
      flag = 1
      break
    else:
      ans[i] = a[i][0] 
  if len(set(a[i]))>1:
    flag = 1
    break
  elif a[i]:
    ans[i] = a[i][0]
if flag == 0:
  if ans[0] == 0:
    if len(a) == 1:
      ans[0] = 0
    else:
      ans[0] = 1
  ans = ''.join((str(n) for n in ans))
  print(int(ans))
else:
  print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
import numpy as np
p = np.array(p)
p = (p + 1)/2
ans = -1
for i in range(N-K+1):
  a = np.sum(p[i:i+K])
  if a > ans:
    ans = a
print(ans)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))
import numpy as np
p = np.array(p)
p = (p + 1)/2
ans = -1
for i in range(N-K+1):
  if i == 0:
    a = np.sum(p[:K])
  else:
    a = (a-p[i-1]+p[i+K-1])
  if a > ans:
    ans = a
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod
  
p = 1000000007
ans = 0  
for i in range(N- K +1):
  ans += ((A[N-1-i] - A[i])*comb(N-1-i, K-1, p))
  ans = ans % p
print(ans)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)
p = 1000000007
frac = [1]
for i in range(N):
  frac.append(frac[i]*(i+1)%p)

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod
  

ans = 0  
for i in range(N- K +1):
  ans += ((A[N-1-i] - A[i])*comb(N-1-i, K-1, p))
  ans = ans % p
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if K <= A:
  print(*[A-K, B])
elif K <= A + B:
  print(*[0, B-(K-A)])
else:
  print(*[0, 0])


Fixed submission:
T, S = map(str, input().split())
print(S + T)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
p = 10**9 + 7
num_a = [0]*60
str_a = []
for i in a:
  a_str = format(i, 'b').zfill(60)
  str_a.append(a_str)
  for j in range(len(a_str)):
    if a_str[-1-j] == '1':
      num_a[j] += 1
ans = 0
cnt = 0

for i, j in enumerate(num_a):
  ans =  (ans + j*(n-j)*2**i)%p

print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
p = 10**9 + 7
ans = 0
for i in range(60):
  c = np.count_nonzero(a & 1)
  ans = (ans + c*(n-c)*2**i) % p
  a = a >> 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
p = 10**9 + 7
num_a = [0]*60
str_a = []
for i in a:
  a_str = format(i, 'b').zfill(60)
  str_a.append(a_str)
  for j in range(len(a_str)):
    if a_str[-1-j] == '1':
      num_a[j] += 1
ans = 0
cnt = 0
for i in str_a:
  cnt += 1
  if cnt >= n:
    break
  for j in range(len(i)):
    if i[-1-j] == '1':
      num_a[j] -= 1
      ans += (n-cnt-num_a[j])*2**j
      ans = ans % p
    else:
      ans += num_a[j]*2**j % p
      ans = ans % p
      
print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
p = 10**9 + 7
ans = 0
for i in range(60):
  c = np.count_nonzero(a & 1)
  ans = (ans + c*(n-c)*2**i) % p
  a = a >> 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N ＝ int(input())
if N%2＝＝0:
  print(N//2-1)
else:
  print(N//2)

Fixed submission:
N = int(input())
if N%2==0:
  print(N//2-1)
else:
  print(N//2)
Buggy python submission (verdict: Runtime Error):
S = list(str(input()))

count = 0
count_bef = 0
count_list=[]
count_list2=[]
minus = []
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    count += 1
  elif not S[i] ==S[i+1]:
    count_list.append(int((count+1)*(count+2)/2))
    count_list2.append(count+1)
    count = 0
count_list.append(int((count+1)*(count+2)/2))
count_list2.append(count+1)
if S[0] == "<":
  for i in range(len(count_list2)//2):
    minus.append(min(count_list2[2*i], count_list2[2*i+1]))
elif S[0] == ">":
  for i in range(len(count_list2)//2):
    minus.append(min(count_list2[2*i+1], count_list2[2*i+2]))
    
#print(count_list)
#print(count_list2)
#print(minus)
print(sum(count_list)-sum(minus))

Fixed submission:
S = list(str(input()))

count = 0
count_bef = 0
count_list=[]
count_list2=[]
minus = []
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    count += 1
  elif not S[i] ==S[i+1]:
    count_list.append(int((count+1)*(count+2)/2))
    count_list2.append(count+1)
    count = 0
count_list.append(int((count+1)*(count+2)/2))
count_list2.append(count+1)
if S[0] == "<":
  for i in range(len(count_list2)//2):
    minus.append(min(count_list2[2*i], count_list2[2*i+1]))
elif S[0] == ">":
  try:
    for i in range(len(count_list2)//2):
      minus.append(min(count_list2[2*i+1], count_list2[2*i+2]))
  except IndexError:
    pass
#print(count_list)
#print(count_list2)
#print(minus)
print(sum(count_list)-sum(minus))
Buggy python submission (verdict: Runtime Error):
N = input()
a = N - N//2
print(a / N)

Fixed submission:
N = float(input())
a = N - N//2
print(a / N)

Buggy python submission (verdict: Runtime Error):
N = input()
a = N - N//2
print(float(a / N))

Fixed submission:
N = float(input())
a = N - N//2
print(a / N)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split)
a = list(map(int, input().split))
count = 0
for i in range(len(a)):
    if a[i] >= K:
        count += 1
print(count)

Fixed submission:
N, K = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(len(a)):
    if a[i] >= K:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split)
a = list(map(int, input().split))
count = 0
for i in range(len(a)):
  if a[i] >= K:
    count += 1
print(count)

Fixed submission:
N, K = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(len(a)):
    if a[i] >= K:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
import numpy as np
A = np.array(A)
for i in range(n):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
import numpy as np
A = np.array(A)
for i in range(N):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = map(int, input().split())
import numpy as np
A = np.array(A)
B = []
for i in range(n):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, input().split())
import numpy as np
A = np.array(A)
B = []
for i in range(N):
    b = np.where(A==i+1)
    print(b[0][0]+1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
list_st = []
for i in range(N):
  print(A.index(i+1)+1)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
list_st = []
for i in range(N):
  list_st.append(A.index(i+1)+1)
for i in range(N):
  print(list_st[i])

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
list_st = []
for i in range(N):
  list_st.append(A.index(i+1)+1)
for i in range(N):
  print(list_st[i])

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
B = [0]*n
for i in range(n):
  B[A[i]-1] = i + 1 
for i in range(n):
  print(B[i])
Buggy python submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]-1] += 1
for i in range(N):
  if point_list <= 0:
    print("No")
  else:
    print("Yes")
  

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]-1] += 1
for i in range(N):
  if point_list[i] <= 0:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]] += 1
for i in range(N):
  if point_list <= 0:
    print("No")
  else:
    print("Yes")
  

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]

point_list = [K-Q]*N

for i in range(Q):
  point_list[A[i]-1] += 1
for i in range(N):
  if point_list[i] <= 0:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = list(map(int, input().solit()))

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))

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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = list(map(int, input().solit()))

import heapq
a = [-1*i for i in a]
a = heapq.haapify(a)
for i in range(M):
  b = heapq.heappop(a)
  b = (-1*b)//2
  heap.heappush(a, -1*b)
print(-1*sum(a))

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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = list(map(int, input().solit()))

import heapq
a = [-1*i for i in a]
a = heapq.haapify(a)
for i in range(M):
  b = heapq.heappop(a)
  b = (-1*b)//2
  heap.heap.push(a, -1*b)
print(-1*sum(a))

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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = list(map(int, input().solit()))

import heapq
a = [-1*i i for i in a]
a = heapq.haapify(a)
for i in range(M):
  b = heapq.heappop(a)
  b = (-1*b)//2
  heap.heap.push(a, -1*b)
print(-1*sum(a))

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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))

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

import numpy as np
for i in range(M):
  A[np.argmax(np.array(A))] //= 2
print(sum(A))


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

import heapq
a = [-1*i for i in a]
heapq.heapify(a)
for i in range(M):
    b = heapq.heappop(a)
    b = (-1*b)//2
    heapq.heappush(a, -1*b)
print(-1*sum(a))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  point += B[A[i]]
  if i>0 and A[i] == A[i-1]:
    point += C[A[i-1]]
print(point)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
    point += B[A[i]-1]
    if i>0 and A[i]-1 == A[i-1]:
        point += C[A[i-1]-1]
print(point)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  point += B[A[i]]
  if i>0 and A[i] = A[i-1]:
    point += C[A[i-1]]
print(point)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
    point += B[A[i]-1]
    if i>0 and A[i]-1 == A[i-1]:
        point += C[A[i-1]-1]
print(point)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  count+= B[A[i]]
  if i>0 and A[i] = A[i-1]:
    count += C[A[i-1]]
print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
    point += B[A[i]-1]
    if i>0 and A[i]-1 == A[i-1]:
        point += C[A[i-1]-1]
print(point)