ZhenlongDai/ACPR huggingface dataset:
Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
O = input()


E = input()

S = []

if len(O) == len(E):
	for i in range(len(O)):
		S.append(O[i] + E[i])
else:
	for i in range(len(E)):
		S.append(O[i] + E[i])
		S.append(O[-1])

print("".join(S))

Failing test case input:
bsoteetrengienbrmdpcta
dsennrcatlugfqucaoste

Expected output:
bdssoetnenertcraetnlguigefnqburcmadopscttea


Actual output:
bdassaoeatnaenaeratcaraaetanlaguaigaefanqabuarcamaadoapsactatea


Fixed submission (verdict: Accepted):
O = input()


E = input()

S = []

if len(O) == len(E):
	for i in range(len(O)):
		S.append(O[i] + E[i])
else:
	for i in range(len(E)):
		S.append(O[i] + E[i])
	S.append(O[-1])

print("".join(S))

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

O = input()
E = input()

for o, e in zip(O, E):
    print(o + e, end="")

Failing test case input:
tsgtencrenoieabrmdoctf
etcoaarqeguldrcnntest

Expected output:
testgctoeanacrrqeengouiledarbcrnmndtoecsttf


Actual output:
testgctoeanacrrqeengouiledarbcrnmndtoecstt

Fixed submission (verdict: Accepted):

O = input()
E = input()

for o, e in zip(O, E):
    print(o + e, end="")
if abs(len(O) - len(E)) == 1:
    print(O[-1])

Problem: p03760
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
o = input()
e = input()
ans = ''
for i,j in zip(o,e):
    ans+= i+j
if len(o) != len(e):
    ans+=e[-1]
print(ans)

Failing test case input:
ntcpdmrbaeionerteetgsb
tseunrcadltgeqncaorte

Expected output:
nttscepudnmrrcbaadelitogneeqrntceaeotrgtseb


Actual output:
nttscepudnmrrcbaadelitogneeqrntceaeotrgtsee


Fixed submission (verdict: Accepted):
o = input()
e = input()

ans = ''
for i,j in zip(o,e):
    ans+= i+j
if len(o) != len(e):
    ans+=o[-1]
print(ans)

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
O = input()
E = input()
ans = ""
for i in range(len(E)):
  ans+=O[i]
  ans+=E[i]
  
if len(O)%2==1:
  ans+=O[len(O)-1]

print(ans)

Failing test case input:
yyx
acd

Expected output:
yaycxd


Actual output:
yaycxdx


Fixed submission (verdict: Accepted):
O = input()
E = input()
ans = ""
for i in range(len(E)):
  ans+=O[i]
  ans+=E[i]
  
if len(O)>len(E):
  ans+=O[len(O)-1]

print(ans)

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
o=input()
e=input()
for i,j in zip(o,e):
    print(i+j,end="")
   

Failing test case input:
ftcodmrbaeinnercoetgst
atcoaerqeguldrcnntest

Expected output:
fattccoodamerrbqaeegiunlnderrccnonettegsstt


Actual output:
fattccoodamerrbqaeegiunlnderrccnonettegsst

Fixed submission (verdict: Accepted):
o=input()
e=input()
for i,j in zip(o,e):
    print(i+j,end="")
if len(o)!=len(e):print(o[-1:])

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
o=list(input())
e=list(input())
for i,j in zip(o,e):print(i+j,end="")

Failing test case input:
ntcpdmrbaeionerteetgsb
tseunrcadltgeqncaorte

Expected output:
nttscepudnmrrcbaadelitogneeqrntceaeotrgtseb


Actual output:
nttscepudnmrrcbaadelitogneeqrntceaeotrgtse

Fixed submission (verdict: Accepted):
o=list(input())
e=list(input())+[""]
for i,j in zip(o,e):print(i+j,end="")
Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
o = input()
e = input()

for x,y in zip( o, e ) : print( x+y, end="" )

Failing test case input:
tsgteocrennieabrmdoctf
tsetnncrdlugeqreaocta

Expected output:
ttssgettenonccrrednlnuigeeaqbrremadooccttaf


Actual output:
ttssgettenonccrrednlnuigeeaqbrremadoocctta

Fixed submission (verdict: Accepted):
o = list(input())
e = list(input()) + [""]

for x,y in zip( o, e ) : print( x+y, end="" )

Problem: p03760
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
o = list(str(input()))
e = list(str(input()))

for i,j in enumerate(e):
    o.insert(1+2*i,j)
print(o)

Failing test case input:
bsoteetrengienbrmdpcta
etsoacuqegultacrnnesd

Expected output:
bestostoeaecturqeengguiletnabcrrmndnpecstda


Actual output:
b e s t o s t o e a e c t u r q e e n g g u i l e t n a b c r r m n d n p e c s t d a

Fixed submission (verdict: Accepted):
o = list(str(input()))
e = list(str(input()))

for i,j in enumerate(e):
    o.insert(1+2*i,j)
print("".join(o))

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def solve():
    o = input()
    e = input()

    for l, r in zip(o, e):
        print('{}{}'.format(l, r), end="")

    if len(o) != len(e):
        print(e[-1])


if __name__ == '__main__':
    solve()


Failing test case input:
bsotheureqdjenbrmdpcta
etsoacgqfuuluacrnoesd

Expected output:
bestostohaecugrqefqudujleunabcrrmndopecstda


Actual output:
bestostohaecugrqefqudujleunabcrrmndopecstdd


Fixed submission (verdict: Accepted):



def solve():
    o = input()
    e = input()

    for l, r in zip(o, e):
        print('{}{}'.format(l, r), end="")

    if len(o) != len(e):
        print(o[-1])
    else:
        print()


if __name__ == '__main__':
    solve()

Problem: p03760
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
o = list(input())
e = list(input()) + []
for i, j in zip(o, e):
    print(i + j, end="")


Failing test case input:
ntcpdmrbaeionerteetgsb
tseunrcadltgeqncaoste

Expected output:
nttscepudnmrrcbaadelitogneeqrntceaeotsgtseb


Actual output:
nttscepudnmrrcbaadelitogneeqrntceaeotsgtse

Fixed submission (verdict: Accepted):
o = list(input())
e = list(input()) + [""]
for i, j in zip(o, e):
    print(i + j, end="")

Problem: p03760
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
o=list(input())
e=list(input())+[""]
for x,y in zip(o,e):print(x,y,end="") 

Failing test case input:
xx{
dac

Expected output:
xdxa{c


Actual output:
x dx a{ c

Fixed submission (verdict: Accepted):
o=list(input())
e=list(input())+[""]
for x,y in zip(o,e):print(x+y,end="")
Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=list(input().split())
r=s.count('R')
b=s.count('B')
if r>b:
  print('Yes')
else:
  print('No')

Failing test case input:
4
ARRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
s=input()
r=s.count('R')
b=s.count('B')
if r>b:
  print('Yes')
else:
  print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys

input = sys.stdin.readline
N = int(input())
s = input().split()
r = 0
b = 0

for i in range(0, len(s)):
    if s[i] == 'R':
        r += 1
    else:
        b += 1

if r > b:
    print("Yes")
else:
    print("No")


Failing test case input:
4
RRRC

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):


import sys

input = sys.stdin.readline
N = int(input())
s = input().strip()
r = 0
b = 0

for i in range(0, len(s)):
    if s[i] == 'R':
        r += 1
    else:
        b += 1

if r > b:
    print("Yes")
else:
    print("No")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=list(input().split())
for i in s:
     n=0
     if i=='R':
         n+=1
if N/2<n:
    print('Yes')
else:
    print('No')

Failing test case input:
4
RRCR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
s=input()
n=0
for char in s:
     if char=='R':
         n+=1
     else:
         n+=0
if N/2<n:
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()

if n - len([i for i in s if i == 'R']) > 0:
    print('Yes')
else:
    print('No')

Failing test case input:
4
RBQB

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
s=input()

if len([i for i in s if i == 'R']) * 2 - n > 0:
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s.count("R") > s.count("B"):
  print("Yes")
else:
  print("No")

Failing test case input:
4
RARR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
if s.count("R") > s.count("B"):
  print("Yes")
else:
  print("No")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
i = int(input())
hat = list(input())

B_count = hat.count('B')
R_count = hat.count('R')

if B_count < R_count:
  print("YES")
else:
  print('NO')

Failing test case input:
4
OBAS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
i = int(input())
hat = list(input())

B_count = hat.count('B')
R_count = hat.count('R')

if B_count < R_count:
  print("Yes")
else:
  print('No')
Problem: p03080
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
s = list(input().split())
cnt = 0
for a in s:
    if s == 'R':
        cnt += 1
if N - cnt < cnt:
    print('Yes')
else:
    print('No')

Failing test case input:
4
DRRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
s = input()
cnt = 0
for a in s:
    if a == 'R':
        cnt += 1
if N - cnt < cnt:
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s = input().split()

r = 0
b = 0
for i in s:
    if i == "R":
        r += 1
    if i == "B":
        b += 1

if r <= b:
    print("No")
else:
    print("Yes")

Failing test case input:
4
RRAR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
s = input()

r = 0
b = 0
for i in s:
    if i == "R":
        r += 1
    if i == "B":
        b += 1

if r <= b:
    print("No")
else:
    print("Yes")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
s = input()

N1 = int(N)/2

import math
math.floor(N1)
N1= int(N1)

list_s = list(s)
list_s.sort()
X = list_s[N1]

if X=='R':
    print('Yes')
else:
    print('No')

Failing test case input:
4
BCRS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = input()
s = input()
 
N1 = int(N)/2
 
import math
N1= math.ceil(N1)
N1= int(N1)-1
 
list_s = list(s)
list_s.sort()
X = list_s[N1]
 
if X=='R':
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = int(input())
B = list(input())

count_RED = 0
for i in range (0, A):
    if B[i] == "R":
        count_RED += 1
count_BLUE = A - count_RED
if (count_RED > count_BLUE):
    print('Yes')
else:
    print('NO')    

Failing test case input:
4
COAS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
A = int(input())
B = list(input())

count_RED = 0
for i in range (0, A):
    if B[i] == "R":
        count_RED += 1
count_BLUE = A - count_RED
if (count_RED > count_BLUE):
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=list(input().split())
n=0
for i in range(N):
     if i=='R':
         n+=1
     else:
         n+=0
if N/2<n:
    print('Yes')
else:
    print('No')

Failing test case input:
4
RRBR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
s=input()
n=0
for char in s:
     if char=='R':
         n+=1
     else:
         n+=0
if N/2<n:
    print('Yes')
else:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = [i for i in input()]
if N.count("R")>N.count("B"):
  print("Yes")
else:
  print("No")

Failing test case input:
4
RRCR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = int(input())
N = [i for i in input()]
if N.count("R")>N.count("B"):
  print("Yes")
else:
  print("No")
Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=input().split()
y=0
v=0
for i in s:
    if i=='R':
        y+=1
    else:
        v+=1
if y>v:
    print('Yes')
else:
    print('No')

Failing test case input:
4
CRRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
s=input()
y=0
v=0
for i in s:
    if i=='R':
        y+=1
    elif i=='B':
        v+=1
if y>v:
    print('Yes')
elif v>=y:
    print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=input(int())
n=input(int())
A=n.count("R")
B=n.count("B")
if A>B:
  print("Yes")
else:
  print("No")

Failing test case input:
4
DRRR

Expected output:
Yes


Actual output:
00Yes


Fixed submission (verdict: Accepted):
N=input(str())
n=input(str())
A=n.count("R")
B=n.count("B")
if A>B:
  print("Yes")
else:
  print("No")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = input()
n1 = N / 2
s1 = s.count("R")
if s1 >= n1:
    print("Yes")
else:
    print("No")

Failing test case input:
4
BRBR

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
s = input()
n1 = N / 2
s1 = s.count("R")
if s1 > n1:
    print("Yes")
else:
    print("No")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = input().split()
print('Yes') if s.count('R') * 2 > N else print('No')

Failing test case input:
4
DRRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
s = input()
print('Yes') if s.count('R')>s.count('B') else print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
count=0
for i in s:
  if i=='B':
    count+=1
if count>(n-count):
  print('Yes')
else:
  print('No')

Failing test case input:
4
ERRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
count=0
for i in s:
  if i=='R':
    count+=1
if count>(n-count):
  print('Yes')
else:
  print('No')

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

a = 0
for s in S:
  if s=="B":
  	  a += 1
if a > N-a:
	print("Yes")
else:
  	print("No")

Failing test case input:
4
RRRD

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
S = input()

a = 0
for s in S:
  if s=="R":
  	  a += 1
if a > N-a:
	print("Yes")
else:
  	print("No")

Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s.count("R")>s.count("B"):
  print("Yes")
else:
  print("No")

Failing test case input:
4
RRBR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
N=input()
s = input()
if s.count("R")>s.count("B"):
  print("Yes")
else:
  print("No")
Problem: p03080
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
red_num = 0
for i in input():
  if i == 'R':
    red_num += 1
print('Yes' if red_num > N else 'No')

Failing test case input:
4
CRRR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
red_num = 0
blue_num = 0
for i in input():
  if i == 'R':
    red_num += 1
  else:
    blue_num += 1
print('Yes' if red_num > blue_num else 'No')
Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M=[int(i) for i in input().split()]
A = [int(i) for i in input().split()]
for i in range(M):
  l=A.index(max(A))
  A[l]
print(sum(A))

Failing test case input:
3 3
2 3 5

Expected output:
4


Actual output:
10


Fixed submission (verdict: Accepted):
import heapq
N,M=[int(i) for i in input().split()]
A=sorted([-int(i) for i in input().split()])
for i in range(M):heapq.heappush(A,-(-heapq.heappop(A)
print(-sum(A))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

n,m = map(int,input().split())
price = [-int(i) for i in input().split()]

heapq.heapify(price)
for i in range(m):
    a = heapq.heappop(price)
    heapq.heappush(price,a)
print(-sum(price))
    

Failing test case input:
10 1
1000001000 1001010000 1011000000 1100000000 1000001000 1000000100 1000000000 1010010000 1000010000 1100000000

Expected output:
9672032100


Actual output:
10222032100


Fixed submission (verdict: Accepted):
import heapq

n,m = map(int,input().split())
price = [-int(i) for i in input().split()]

heapq.heapify(price)

for i in range(m):
    
    a = int(heapq.heappop(price)/2)
    heapq.heappush(price,a)
    
print(-sum(price))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import heapq
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(a)
for _ in range(m):
    heapq.heappush(a,(-1)*(heapq.heappop(a)/2))
print(int(sum(a)*(-1)))

Failing test case input:
3 3
2 3 5

Expected output:
4


Actual output:
-5


Fixed submission (verdict: Accepted):
import sys
import heapq
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(a)
for _ in range(m):
    mina=int(heapq.heappop(a)/2)
    heapq.heappush(a,mina)
print(sum(a)*(-1))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
from bisect import insort


def main():
    N, M = [int(x) for x in stdin.readline().rstrip().split()]
    As = [int(x) for x in stdin.readline().rstrip().split()]
    As.sort()
    for _ in range(M):
        x = As[-1] / 2
        insort(As, x)
        del As[-1]
    sum_ = 0
    for x in As:
        sum_ += x
    print(sum_)


if __name__ == "__main__":
    main()


Failing test case input:
10 1
1000010001 1011000000 1110000000 1100000000 1000001000 0000000100 1000000000 1010010001 1000011000 1100000000

Expected output:
8776032102


Actual output:
8776032102.0


Fixed submission (verdict: Accepted):
from sys import stdin
import heapq


def main():
    N, M = [int(x) for x in stdin.readline().rstrip().split()]
    As = []
    for i in [int(x) for x in stdin.readline().rstrip().split()]:
        heapq.heappush(As, -i)
    for _ in range(M):
        x = heapq.heappop(As)
        heapq.heappush(As, x / 2)
    print(sum([-1 * int(x) for x in As]))


if __name__ == "__main__":
    main()
Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
 
s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=0
b=0
c=0
d=s[1]
t.sort(reverse=True)
if s[0]==1:
  for i in range(s[1]):
    t[0]=math.floor(t[0]/2)
else:
  c=t[0]/2
  for j in range(s[1]):
    for l in range(s[0]):
      if d>0:
        if c<=t[l]:
          t[l]=math.floor(t[l]/2)
          d=d-1
        else:
            t.sort(reverse=True)
            c=t[0]/2
            continue
      else:
        break
print(sum(t))

Failing test case input:
3 3
2 3 8

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
import math
 
s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=0
b=0
c=0
d=s[1]
t.sort(reverse=True)
if s[0]==1:
  for i in range(s[1]):
    t[0]=math.floor(t[0]/2)
else:
  c=t[0]/2
  for j in range(s[1]):
    for l in range(s[0]):
      if d>0:
        if c<t[l]:
          t[l]=math.floor(t[l]/2)
          d=d-1
        else:
            t.sort(reverse=True)
            c=t[0]/2
            break
      else:
        break
e=sum(t)
print(e)

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq, math
n, m = map(int, input().split())
a = list(map(int, input().split()))
ar = [-i for i in a]
heapq.heapify(ar)

while m > 0:
    discount = heapq.heappop(ar)
    heapq.heappush(ar, discount/2)
    m -= 1

print(math.floor(-sum(ar)))


Failing test case input:
4 4
1 9 3 5

Expected output:
6

Actual output:
7


Fixed submission (verdict: Accepted):
import heapq, math
n, m = map(int, input().split())
a = list(map(int, input().split()))
ar = [-i for i in a]
heapq.heapify(ar)

for _ in range(m):
    discount = heapq.heappop(ar)
    heapq.heappush(ar, discount/2)

ans = 0
for i in ar:
    ans += math.floor(-i)

print(ans)

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())
import heapq
A = list(map(int, input().split()))
A = [(-x,x) for x in A]
heapq.heapify(A)
def conf(A, M):
    if M > 0:
        a = heapq.heappop(A)[1]
        heapq.heappush(A, (-int(a/2), int(a/2)))
    else:
        return A
    return conf(A, M-1)
B = [a[1] for a in A]
print(sum(B))

Failing test case input:
10 1
1000000000 1001000000 1010000000 1100000000 1000000000 1000000000 1000000000 1010010000 1000000000 1100000000

Expected output:
9671010000


Actual output:
10221010000


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
import heapq
A = list(map(int, input().split()))
A = [(-x,x) for x in A]
heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A)[1]
    heapq.heappush(A, (-int(a/2), int(a/2)))
B = [a[1] for a in A]
print(sum(B))
Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))
q = []
heapq.heapify(q)

for i in range(n):
    heapq.heappush(q, -a[i])

for _ in range(m):
    b = heapq.heappop(q) / 2
    heapq.heappush(q, b)

print(math.floor(sum(q) * -1))


Failing test case input:
4 4
1 9 3 5

Expected output:
6

Actual output:
7


Fixed submission (verdict: Accepted):
import heapq
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))
q = []
heapq.heapify(q)

for i in range(n):
    heapq.heappush(q, -a[i])

for _ in range(m):
    b = heapq.heappop(q) / 2
    heapq.heappush(q, math.ceil(b))

print(sum(q) * -1)

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
li = [-int(x) for x in input().split()]
import heapq
heapq.heapify(li)
for i in range(b):
    c = heapq.heappop(li)
    heapq.heappush(li,c/2)
print(-int(sum(li)))

Failing test case input:
4 4
1 9 3 5

Expected output:
6

Actual output:
7


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
li = [-int(x) for x in input().split()]
import heapq
heapq.heapify(li)
for i in range(b):
    c = heapq.heappop(li)
    heapq.heappush(li,c/2)
li = [int(x) for x in li]
print(-sum(li))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

mnum, gnum = map(int, input().split())
array = list(map(lambda a: -int(a), input().split()))

array.sort()
heapq.heapify(array)

for i in range(gnum):
	temp = heapq.heappop(array)
	temp = temp/2
	heapq.heappush(array, temp)
    
print(sum(array)*-1)

Failing test case input:
10 1
1000010000 1001000000 1000000000 1000000000 1001000000 1000000000 1001000010 1010000000 1000000000 1000000000

Expected output:
9508010010


Actual output:
9508010010.0


Fixed submission (verdict: Accepted):
import math
import heapq

N, M = list(map(int, input().split()))
A = list(map(lambda a: -int(a), input().split()))
A.sort()
heapq.heapify(A)

for i in range(M):
  a = heapq.heappop(A)
  a /= 2.0
  heapq.heappush(A, a)

amount = 0
for a in A:
  amount += math.floor(-a)
print(amount)

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
mvals = list(map(lambda x: -int(x), input().split()))

import heapq
heapq.heapify(mvals)

for _ in range(M):
    price = heapq.heappop(mvals)
    heapq.heappush(mvals, price / 2)

res = -int(sum(mvals))
print(res)

Failing test case input:
4 4
1 9 3 5

Expected output:
6

Actual output:
7


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
mvals = list(map(lambda x: -int(x), input().split()))

import heapq
heapq.heapify(mvals)

for _ in range(M):
    price = heapq.heappop(mvals)
    heapq.heappush(mvals, price / 2)

res = sum(map(lambda x:int(-x), mvals))
print(res)
Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import heapq
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(a)
for _ in range(m):
    heapq.heappush(a,heapq.heappop(a)/2)
print(int(sum(a)*(-1)))

Failing test case input:
4 4
1 9 3 5

Expected output:
6

Actual output:
7


Fixed submission (verdict: Accepted):
import sys
import heapq
input=sys.stdin.readline
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(a)
for _ in range(m):
    mina=int(heapq.heappop(a)/2)
    heapq.heappush(a,mina)
print(sum(a)*(-1))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

A_list = list(map(int, input().split()))

a = list(map(lambda x: x*(-1), A_list))

import heapq
import math


heapq.heapify(a)

print(a)


for i in range(M):
        max_p = heapq.heappop(a)
        max_p = max_p / 2
        heapq.heappush(a, max_p)

res=0
for i in range(N):
        a[i] = -a[i]
        res += math.floor(a[i])

print(res)

Failing test case input:
10 1
1000001000 1001000000 1000100000 1000000100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

Expected output:
9500601100


Actual output:
[-1001000000, -1000001000, -1000100000, -1000000100, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000]
9500601100


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

A_list = list(map(int, input().split()))

a = list(map(lambda x: x*(-1), A_list))

import heapq
import math


heapq.heapify(a)



for i in range(M):
        max_p = heapq.heappop(a)
        max_p = max_p / 2
        heapq.heappush(a, max_p)

res=0
for i in range(N):
        a[i] = -a[i]
        res += math.floor(a[i])

print(res)

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq
X = list(map(int, input().split()))
A = list(map(int, input().split()))
heapq.heapify(A)

for i in range(X[1]):
  x = heapq.heappop(A) * (-1)
  heapq.heappush(A, int(x/2) * (-1))

ans = 0
for i in range(X[0]):
  ans += A[i]

print(ans)

Failing test case input:
10 1
1000010001 1011000000 1110000000 1100000000 1000001000 1000000100 1000000000 1010010000 1000011000 1100000000

Expected output:
9776032101


Actual output:
9831032101


Fixed submission (verdict: Accepted):
import heapq
X = list(map(int, input().split()))

A = list(map(lambda x: int(x)*(-1), input().split())) 
heapq.heapify(A)

for i in range(X[1]):
  x = heapq.heappop(A) * (-1) 
  heapq.heappush(A, int(x/2) * (-1))

ans = 0
for i in range(X[0]):
  ans -= A[i]

print(ans)
Problem: p02912
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,M=map(int,input().split())
A=list(map(int,input().split()))

ans=0
def cheap(x,y):
    x=int(x/(2**y))
    return x

i=0
while(i<M):
    sorted(A)
    A[0]=cheap(A[0],1)
    i+=1

for i in range(0,N):
    ans+=A[i]

print(ans)



Failing test case input:
3 2
2 13 3

Expected output:
8


Actual output:
16


Fixed submission (verdict: Accepted):
import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range (0,len(A)):
    A[i]*=-1

heapq.heapify(A)

ans=0
def cheap(x,y):
    x=int(x/(2**y))
    return x

i=0
while(i<M):
    tmp=heapq.heappop(A)
    tmp=cheap(tmp,1)
    heapq.heappush(A,tmp)
    i+=1

for i in range(0,N):
    ans+=A[i]

print(ans*(-1))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n, m = map(int, input().split())
    a_list = list(map(int, input().split()))

    for _ in range(m):
        a_list[a_list.index(max(a_list))] /= 2

    print(sum(a_list))


if __name__ == '__main__':
    main()


Failing test case input:
10 1
1000000000 1001000000 1000000000 1000000100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

Expected output:
9500500100


Actual output:
9500500100.0


Fixed submission (verdict: Accepted):
import heapq


def main():
    n, m = map(int, input().split())
    a_list = list(map(lambda x: -int(x), input().split()))

    heapq.heapify(a_list)
    for _ in range(m):
        a = heapq.heappop(a_list)
        heapq.heappush(a_list, -(-a 

    print(-sum(a_list))


if __name__ == '__main__':
    main()

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
import heapq


def main():
    N, M = [int(x) for x in stdin.readline().rstrip().split()]
    As = []
    for i in [int(x) for x in stdin.readline().rstrip().split()]:
        heapq.heappush(As, i)
    for _ in range(M):
        x = heapq.heappop(As)
        heapq.heappush(As, x / 2)
    print(sum([int(x) for x in As]))


if __name__ == "__main__":
    main()


Failing test case input:
10 1
1000000000 1000000100 1000000000 1000100000 1000000000 1000000000 1010000000 1010010000 1000000000 1000000000

Expected output:
9515105100


Actual output:
9520110100


Fixed submission (verdict: Accepted):
from sys import stdin
import heapq


def main():
    N, M = [int(x) for x in stdin.readline().rstrip().split()]
    As = []
    for i in [int(x) for x in stdin.readline().rstrip().split()]:
        heapq.heappush(As, -i)
    for _ in range(M):
        x = heapq.heappop(As)
        heapq.heappush(As, x / 2)
    print(sum([-1 * int(x) for x in As]))


if __name__ == "__main__":
    main()
Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

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

heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A) >> 1
    heapq.heappush(A,a)
print(-sum(A))


Failing test case input:
1 101000
1000000000

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import heapq

N , M = map(int,input().split())
A = [-int(i) for i in input().split()]
heapq.heapify(A)
for _ in range(M):
    a = -heapq.heappop(A) >> 1
    heapq.heappush(A,-a)
print(-sum(A))

Problem: p02912
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq
import math

n, m = map(int, input().split())
goods = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(goods)
for i in range(n):
    the_most_expensive = heapq.heappop(goods)
    heapq.heappush(goods, math.ceil(the_most_expensive / 2))

print(sum(goods) * -1)


Failing test case input:
10 2
1000000000 1001000000 1110000000 1100000000 1000001000 1000000000 1000000000 1010010000 1000000000 1100000000

Expected output:
9216011000


Actual output:
5160505500


Fixed submission (verdict: Accepted):
import heapq
import math

n, m = map(int, input().split())
goods = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(goods)
for i in range(m):
    the_most_expensive = heapq.heappop(goods)
    heapq.heappush(goods, math.ceil(the_most_expensive / 2))

print(sum(goods) * -1)
Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
ans=180*(N-1)
print(ans)


Failing test case input:
-135

Expected output:
-24660


Actual output:
-24480


Fixed submission (verdict: Accepted):
N=int(input())
ans=180*(N-2)
print(ans)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
count = 180 - int(360 / n)
print(count * n)


Failing test case input:
-131

Expected output:
-23940


Actual output:
-23842


Fixed submission (verdict: Accepted):

n = int(input())
count = 180 - 360 / n
print( int(count * n) )

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(180*(N-1))

Failing test case input:
-484

Expected output:
-87480


Actual output:
-87300


Fixed submission (verdict: Accepted):
N = int(input())
print(180*(N-2))

Problem: p03023
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

rtn = 180 *  (N-2) /N
print(rtn*N)


Failing test case input:
-361

Expected output:
-65340


Actual output:
-65340.0


Fixed submission (verdict: Accepted):
N = int(input())

rtn = 180 *  (N-2) /N
print(int(rtn*N))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print((n-3)*180)

Failing test case input:
-636

Expected output:
-114840


Actual output:
-115020


Fixed submission (verdict: Accepted):
n = int(input())
print((n-2)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n):
    
    
    
    
    

    return (180 - (360 / n)) * n


do_submit = True


def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    
    
    
    return n


if not do_submit:
    n = input_parse()
    print(sol(n))

    n = input_parse()
    print(sol(n))

else:
    
    
    
    n = int(input().strip())
    
    print(sol(n))



Failing test case input:
-291

Expected output:
-52740


Actual output:
-52740.0


Fixed submission (verdict: Accepted):



from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n):
    
    
    
    
    

    return int((180 - (360 / n)) * n)


do_submit = True


def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    
    
    
    return n


if not do_submit:
    n = input_parse()
    print(sol(n))

    n = input_parse()
    print(sol(n))

else:
    
    
    
    n = int(input().strip())
    
    print(sol(n))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
(int(input())-2) * 180

Failing test case input:
893

Expected output:
160380


Actual output:

Fixed submission (verdict: Accepted):
print((int(input())-2) * 180)
Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
input = sys.stdin.readline

n = int(input())
print(360+(n-3)*180)

Failing test case input:
862

Expected output:
154800


Actual output:
154980


Fixed submission (verdict: Accepted):

import sys
input = sys.stdin.readline

n = int(input())
print(180+(n-3)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N-1*90)

Failing test case input:
-166

Expected output:
-30240


Actual output:
-256


Fixed submission (verdict: Accepted):
N = int(input())
print((N-2)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print((180-360/n)*n)

Failing test case input:
893

Expected output:
160380


Actual output:
160380.0


Fixed submission (verdict: Accepted):
n = int(input())

print(int((180-360/n)*n))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*90)

Failing test case input:
-151

Expected output:
-27540


Actual output:
-13590


Fixed submission (verdict: Accepted):
n=int(input())
print(180*(n-2))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print((int(input())-3)*180)

Failing test case input:
862

Expected output:
154800


Actual output:
154620


Fixed submission (verdict: Accepted):
print((int(input())-2)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*180)

Failing test case input:
-484

Expected output:
-87480


Actual output:
-87120


Fixed submission (verdict: Accepted):
n=int(input())
print(180*(n-2))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(180*(N-1))

Failing test case input:
-246

Expected output:
-44640


Actual output:
-44460


Fixed submission (verdict: Accepted):
N = int(input())
print(180*(N-2))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(180*(N-1))

Failing test case input:
-391

Expected output:
-70740


Actual output:
-70560


Fixed submission (verdict: Accepted):
N = int(input())
print(180*(N-2))

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
(int(input())-2)*180

Failing test case input:
-192

Expected output:
-34920


Actual output:

Fixed submission (verdict: Accepted):
print((int(input())-2)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print((N-2)*360)

Failing test case input:
-135

Expected output:
-24660


Actual output:
-49320


Fixed submission (verdict: Accepted):
N=int(input())
print((N-2)*180)

Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

print(180 * (N - 3))


Failing test case input:
-151

Expected output:
-27540


Actual output:
-27720


Fixed submission (verdict: Accepted):
N = int(input())

print(180 * (N - 2))

Problem: p03023
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
print(90*n)

Failing test case input:
-391

Expected output:
-70740


Actual output:
-35190


Fixed submission (verdict: Accepted):
n = int(input())
print(180*(n-2))
Problem: p03023
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print((n-1)*180)

Failing test case input:
-729

Expected output:
-131580


Actual output:
-131400


Fixed submission (verdict: Accepted):
n = int(input())

print((n-2)*180)
Problem: p02287
Buggy submission (Python3, verdict: Wrong Answer):

import math

class Tree():
    def __init__(self, key):
        self.root = key

class Node():
    def __init__(self, id, key):
        self.id = id
        self.key = key
        self.parent = None
        self.left = None
        self.right = None

    def set_status(self, id, key):
        global node_list
        parent_id = math.floor(id/2)
        odd = id % 2
        self.parent = node_list[parent_id]
        if odd == 0:
            self.parent.left = self
        else:
            self.parent.right = self

def print_nodes():
    global node_list
    node_list.pop(0)
    for node in node_list:
        print("node {}: key = {}".format(node.id, node.key), end = "")
        if node.parent:
            print(", parent key = {}".format(node.parent.key), end = "")
        if node.left:
            print(", left key = {}".format(node.left.key), end = "")
        if node.right:
            print(", right key = {}".format(node.right.key), end = "")
        print()

n = int(input())
input_num = list(map(int, input().split()))
node_list = [None]

for i, num in enumerate(input_num):
    i = i + 1 
    node = Node(i, num)
    node_list.append(node)

    if i == 1:
        tree = Tree(num)
    else:
        node.set_status(i, num)

print_nodes()

Failing test case input:
5
2 23 0 0 1

Expected output:
node 1: key = 2, left key = 23, right key = 0, 
node 2: key = 23, parent key = 2, left key = 0, right key = 1, 
node 3: key = 0, parent key = 2, 
node 4: key = 0, parent key = 23, 
node 5: key = 1, parent key = 23, 


Actual output:
node 1: key = 2, left key = 23, right key = 0
node 2: key = 23, parent key = 2, left key = 0, right key = 1
node 3: key = 0, parent key = 2
node 4: key = 0, parent key = 23
node 5: key = 1, parent key = 23


Fixed submission (verdict: Accepted):

import math

class Tree():
    def __init__(self, key):
        self.root = key

class Node():
    def __init__(self, id, key):
        self.id = id
        self.key = key
        self.parent = None
        self.left = None
        self.right = None

    def set_status(self, id, key):
        global node_list
        parent_id = math.floor(id/2)
        odd = id % 2
        self.parent = node_list[parent_id]
        if odd == 0:
            self.parent.left = self
        else:
            self.parent.right = self

def print_nodes():
    global node_list
    node_list.pop(0)
    for node in node_list:
        print("node {}: key = {}".format(node.id, node.key), end = "")
        if node.parent:
            print(", parent key = {}".format(node.parent.key), end = "")
        if node.left:
            print(", left key = {}".format(node.left.key), end = "")
        if node.right:
            print(", right key = {}".format(node.right.key), end = "")
        print(", ")

n = int(input())
input_num = list(map(int, input().split()))
node_list = [None]

for i, num in enumerate(input_num):
    i = i + 1 
    node = Node(i, num)
    node_list.append(node)

    if i == 1:
        tree = Tree(num)
    else:
        node.set_status(i, num)

print_nodes()
Problem: p02287
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
klist = list(map(int,input().split()))
plist = []
i = 0
k = 1
a = 2**i-1
while 1:
    if klist[a:a+2**i] != []:
        plist.append(klist[a:a + 2**i])
    else: break
    a += 2**i
    i += 1
print(plist)
print(len(plist))
for i in range(len(plist)):
    for j in range(len(plist[i])):
        try:
            if i==0:
                print("node"+str(k)+": key ="+str(plist[0][0])+
                      ", left key ="+str(plist[1][0])+
                      ", right key ="+str(plist[1][1])+",")
            else :
                l = int(j/2)
                print("node"+str(k)+": key ="+str(plist[i][j])+", parent key ="+
                      str(plist[i-1][l])+", left key ="+str(plist[i+1][2*j])+
                      ", right key ="+str(plist[i+1][2*j+1]))
        except:
            l = int(j/2)
            print("node"+str(k)+": key ="+str(plist[i][j])+
                  ", parent key ="+str(plist[i-1][l]))
        k += 1


Failing test case input:
5
1 0 -3 4 0

Expected output:
node 1: key = 1, left key = 0, right key = -3, 
node 2: key = 0, parent key = 1, left key = 4, right key = 0, 
node 3: key = -3, parent key = 1, 
node 4: key = 4, parent key = 0, 
node 5: key = 0, parent key = 0, 


Actual output:
[[1], [0, -3], [4, 0]]
3
node1: key =1, left key =0, right key =-3,
node2: key =0, parent key =1, left key =4, right key =0
node3: key =-3, parent key =1
node4: key =4, parent key =0
node5: key =0, parent key =0


Fixed submission (verdict: Accepted):
n = int(input())
klist = list(map(int,input().split()))
plist = []
i = 0
k = 1
a = 2**i-1
while 1:
    if klist[a:a+2**i] != []:
        plist.append(klist[a:a + 2**i])
    else: break
    a += 2**i
    i += 1
for i in range(len(plist)):
    for j in range(len(plist[i])):
        try:
            if i==0:
                print("node "+str(k)+": key = "+str(plist[0][0])+
                      ", left key = "+str(plist[1][0])+
                      ", right key = "+str(plist[1][1])+", ")
            else :
                l = int(j/2)
                print("node "+str(k)+": key = "+str(plist[i][j])+
                      ", parent key = "+str(plist[i-1][l])+", left key = "+
                      str(plist[i+1][2*j]),end="")
                try:
                    print(", right key = "+str(plist[i+1][2*j+1])+", ")
                except:
                    print(", ")
        except:
            l = int(j/2)
            print("node "+str(k)+": key = "+str(plist[i][j])+
                  ", parent key = "+str(plist[i-1][l])+", ")
        k += 1
Problem: p02287
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
klist = list(map(int,input().split()))
plist = []
i = 0
k = 1
a = 2**i-1
while 1:
    if klist[a:a+2**i] != []:
        plist.append(klist[a:a + 2**i])
    else: break
    a += 2**i
    i += 1
print(plist)
print(len(plist))
for i in range(len(plist)):
    for j in range(len(plist[i])):
        try:
            if i==0:
                print("node"+str(k)+": key ="+str(plist[0][0])+
                      ", left key ="+str(plist[1][0])+
                      ", right key ="+str(plist[1][1])+",")
            else :
                l = int(j/2)
                print("node"+str(k)+": key ="+str(plist[i][j])+
                      ", parent key ="+str(plist[i-1][l])+", left key ="+
                      str(plist[i+1][2*j]),end="")
                try:
                    print(", right key ="+str(plist[i+1][2*j+1])+",")
                except:
                    print(",")
        except:
            l = int(j/2)
            print("node"+str(k)+": key ="+str(plist[i][j])+
                  ", parent key ="+str(plist[i-1][l])+",")
        k += 1



Failing test case input:
5
-4 5 4 7 -1

Expected output:
node 1: key = -4, left key = 5, right key = 4, 
node 2: key = 5, parent key = -4, left key = 7, right key = -1, 
node 3: key = 4, parent key = -4, 
node 4: key = 7, parent key = 5, 
node 5: key = -1, parent key = 5, 


Actual output:
[[-4], [5, 4], [7, -1]]
3
node1: key =-4, left key =5, right key =4,
node2: key =5, parent key =-4, left key =7, right key =-1,
node3: key =4, parent key =-4,
node4: key =7, parent key =5,
node5: key =-1, parent key =5,


Fixed submission (verdict: Accepted):
n = int(input())
klist = list(map(int,input().split()))
plist = []
i = 0
k = 1
a = 2**i-1
while 1:
    if klist[a:a+2**i] != []:
        plist.append(klist[a:a + 2**i])
    else: break
    a += 2**i
    i += 1
for i in range(len(plist)):
    for j in range(len(plist[i])):
        try:
            if i==0:
                print("node "+str(k)+": key = "+str(plist[0][0])+
                      ", left key = "+str(plist[1][0])+
                      ", right key = "+str(plist[1][1])+", ")
            else :
                l = int(j/2)
                print("node "+str(k)+": key = "+str(plist[i][j])+
                      ", parent key = "+str(plist[i-1][l])+", left key = "+
                      str(plist[i+1][2*j]),end="")
                try:
                    print(", right key = "+str(plist[i+1][2*j+1])+", ")
                except:
                    print(", ")
        except:
            l = int(j/2)
            print("node "+str(k)+": key = "+str(plist[i][j])+
                  ", parent key = "+str(plist[i-1][l])+", ")
        k += 1
Problem: p02287
Buggy submission (Python3, verdict: Wrong Answer):

import sys
from math import floor
sys.setrecursionlimit(100000)

N = int(input())
heap = [None] + [int(n) for n in input().split()]

for i, h in enumerate(heap[1:]):
    i += 1
    text = "node {}: key = {}".format(i, h)
    if i != 1:
        text += ", parent key = {}".format(heap[floor(i/2)])
    if 2 * i <= N:
        text += ", left key = {}".format(heap[2*i])
    if 2 * i + 1 <= N:
        text += ", right key = {}".format(heap[2*i + 1])
    print(text)

Failing test case input:
5
1 0 -3 4 -2

Expected output:
node 1: key = 1, left key = 0, right key = -3, 
node 2: key = 0, parent key = 1, left key = 4, right key = -2, 
node 3: key = -3, parent key = 1, 
node 4: key = 4, parent key = 0, 
node 5: key = -2, parent key = 0, 


Actual output:
node 1: key = 1, left key = 0, right key = -3
node 2: key = 0, parent key = 1, left key = 4, right key = -2
node 3: key = -3, parent key = 1
node 4: key = 4, parent key = 0
node 5: key = -2, parent key = 0


Fixed submission (verdict: Accepted):

import sys
from math import floor
sys.setrecursionlimit(100000)

N = int(input())
heap = [None] + [int(n) for n in input().split()]

for i, h in enumerate(heap[1:]):
    i += 1
    text = "node {}: key = {}, ".format(i, h)
    if i != 1:
        text += "parent key = {}, ".format(heap[floor(i/2)])
    if 2 * i <= N:
        text += "left key = {}, ".format(heap[2*i])
    if 2 * i + 1 <= N:
        text += "right key = {}, ".format(heap[2*i + 1])
    print(text)