Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#a,b,c,d,e,k = 2,4,7,8,15,1
#box = [a,b,c,d,e]
box = []
for i in range(0,5):
    box.append(int(input())
k = int(input())
c = 0
for i in range(0,4):
    if box[i+1] - box[i] > k :
        c +=1
    else:
        pass
if c == 0:
    print("Yay!")
else:
    print(":(")

Fixed submission:
# -*- coding: utf-8 -*-
#a,b,c,d,e,k = 2,4,7,8,15,1
#box = [a,b,c,d,e]
import itertools
box = []
for i in range(0,5):
    box.append(int(input()))
k = int(input())
c = 0
for two in list(itertools.combinations(box,2)):
    if (two[1]- two[0] > k):
        c +=1
    else:
        pass
if c == 0:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#a,b,c,d,e,k = 2,4,7,8,15,1
#box = [a,b,c,d,e]
box = []
for i in range(0,5):
    box.append(int(input())
c = 0
for i in range(0,4):
    if box[i+1] - box[i] > k :
        c +=1
    else:
        pass
if c == 0:
    print("Yay!")
else:
    print(":(")

Fixed submission:
# -*- coding: utf-8 -*-
#a,b,c,d,e,k = 2,4,7,8,15,1
#box = [a,b,c,d,e]
import itertools
box = []
for i in range(0,5):
    box.append(int(input()))
k = int(input())
c = 0
for two in list(itertools.combinations(box,2)):
    if (two[1]- two[0] > k):
        c +=1
    else:
        pass
if c == 0:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
B
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += ((box[i]//10)*10+10)
print(sumtime)

Fixed submission:
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += (box[i] // 10)*10+10
print(sumtime)

Buggy python submission (verdict: Runtime Error):
B
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += (box[i] // 10)*10+10
print(sumtime)

Fixed submission:
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += (box[i] // 10)*10+10
print(sumtime)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#文字列の入力
s = input()
# 出力
#box1 = ["A", "T"]
#box2 = ["G", "C"]
if s =="A":
  print("T")
elif s=="T":
  print("A")
elif S == "C":
  print("G")
elif S== "G":
  print("C")

Fixed submission:
# -*- coding: utf-8 -*-
#文字列の入力
s = input()
# 出力
#box1 = ["A", "T"]
#box2 = ["G", "C"]
if s =="A":
  print("T")
elif s=="T":
  print("A")
elif s == "C":
  print("G")
elif s == "G":
  print("C")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox): 
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Buggy python submission (verdict: Runtime Error):
S = str(input())
box = ["A", "G", "C", "T"]
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox): 
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Buggy python submission (verdict: Runtime Error):
S = input()
box = ["A", "G", "C", "T"]
 
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Buggy python submission (verdict: Runtime Error):
s = input()
box = ["A", "G", "C", "T"]

ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Fixed submission:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = [int(i) for i in input().split()]

t = 0
if N >= 2:
  for i in range(N-1):
    if H[i] >= min(H[i+1:N]) + 2:
      t += 1
    
if t == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]

t = 0
s = 0
if N >= 2:
  for i in range(N-1):
    if H[i] > H[i+1]:
      t += 1
      if t == 2:
        s += 1
    if H[i] < H[i+1]:
      t = 0
    if H[i] >= H[i+1] +2:
      s += 1
if s == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = [int(i) for i in input().split()]

t = 0
if N >= 2:
  for i in range(N-1):
    for j in range(i+1, N):
      if H[i] - H[j] >= 2:
        t += 1

if t == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]

t = 0
s = 0
if N >= 2:
  for i in range(N-1):
    if H[i] > H[i+1]:
      t += 1
      if t == 2:
        s += 1
    if H[i] < H[i+1]:
      t = 0
    if H[i] >= H[i+1] +2:
      s += 1
if s == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = list([int(input()) for i in range(N)])
a = max(lst)
for i in range(N):
  if lst[i] != a:
    print(a)
  else:
    copy_lst = lst.copy()
    copy_lst.remove(copy_lst[i])
    print(max(copy_lst))

Fixed submission:
N = int(input())
lst = list([int(input()) for i in range(N)])
a = sorted(lst,reverse=True)
for i in range(N):
  if lst[i] != a[0]:
    print(a[0])
  else:
    print(a[1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = list([int(input()) for i in range(N)])

for i in range(N):
  copy_lst = lst.copy()
  copy_lst.remove(copy_lst[i])
  print(max(copy_lst))

Fixed submission:
N = int(input())
lst = list([int(input()) for i in range(N)])
a = sorted(lst,reverse=True)
for i in range(N):
  if lst[i] != a[0]:
    print(a[0])
  else:
    print(a[1])
Buggy python submission (verdict: Runtime Error):
 print("{:.9g}" {}.format(area/2,1))

Fixed submission:
w, h, x, y = [int(i) for i in input().split()]
area = w*h

print("{:.9f}".format(area/2),end=" ")

if 2*x == w and 2*y == h:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = int(input())

if (N%(2*D-1)==0):
  print(N//(2*D-1))
else:
  print(N//(2*D-1) + 1)

Fixed submission:
N, D = tuple([int(i) for i in input().split(" ")])

if (N%(2*D+1)==0):
  print(N//(2*D+1))
else:
  print(N//(2*D+1) + 1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
D = int(input())

if (N%(2*D-1)==0):
  print(N//(2*D-1))
else:
  print(N//(2*D-1) + 1)

Fixed submission:
N, D = tuple([int(i) for i in input().split(" ")])

if (N%(2*D+1)==0):
  print(N//(2*D+1))
else:
  print(N//(2*D+1) + 1)
Buggy python submission (verdict: Runtime Error):
n = int(input())

one = n % 10
hund = n // 100
thou = n // 1000
cnt = 0

if  n < 10:
    cnt += n

elif 100 > n >= 10:
    cnt += 9

elif 1000 > n >= 100:
    cnt += (n - 99) + 9

elif 10000 > n >= 1000:
    cnt += 909

elif 100000 > n >= 10000:
    cnt += (n - 9999) + 909

elif n = 100000:
    cnt += 90909

print(cnt)


Fixed submission:
n = int(input())

one = n % 10
hund = n // 100
thou = n // 1000
cnt = 0

if  n < 10:
    cnt += n

elif 100 > n >= 10:
    cnt += 9

elif 1000 > n >= 100:
    cnt += (n - 99) + 9

elif 10000 > n >= 1000:
    cnt += 909

elif 100000 > n >= 10000:
    cnt += (n - 9999) + 909

elif n == 100000:
    cnt += 90909

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min_s = 2019
for i in range(L, R):
    for j in range(i + 1, R+1):
        ij = i * j
        m = ij % 2019
        if min_s > m:
            min_s = m
print("{}".format(min_s))

Fixed submission:
L, R = map(int, input().split())
min_s = 2019
if (R - L) > 2019:
    min_s = 0
for i in range(L, R):
    for j in range(i + 1, R+1):
        ij = i * j
        m = ij % 2019
        if min_s > m:
            min_s = m
        if min_s == 0:
            break
    if min_s == 0:
        break
print("{}".format(min_s))
Buggy python submission (verdict: Runtime Error):
s = 0
num_min = L + 1 - 1
num_max = L + N - 1
if 0 < num_min:
    s = sum([L + i - 1 for i in range(1, N+1)] ) - num_min
elif num_max < 0:
    s = sum([L + i - 1 for i in range(1, N+1)] ) - num_max
else:
    s = sum([L + i - 1 for i in range(1, N+1)] )
print(s)

Fixed submission:
N, L = map(int, input().split())
num_min = L + 1 - 1
num_max = L + N - 1
if 0 < num_min:
    s = sum([L + i - 1 for i in range(1, N+1)] ) - num_min
elif num_max < 0:
    s = sum([L + i - 1 for i in range(1, N+1)] ) - num_max
else:
    s = sum([L + i - 1 for i in range(1, N+1)] )
print(s)
Buggy python submission (verdict: Runtime Error):
a, b, c = [int(i) for i in input().split()]

print(c-(a-b))a

Fixed submission:
a, b, c = [int(i) for i in input().split()]
if c-(a-b)<0:
    print(0)
else:
    print(c-(a-b))
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp

print(result)

Fixed submission:
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp
        if result == 0:
            break;
    if result == 0:
        break;

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp

print(result)

Fixed submission:
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp
        if result == 0:
            break;
    if result == 0:
        break;

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp

print(result)

Fixed submission:
L, R = map( int, input().split() )
result = 2019

for i in range(L, R+1):
    for j in range(i+1,R+1):
        tmp = (i*j) % 2019
        if tmp < result:
            result = tmp
        if result == 0:
            break;
    if result == 0:
        break;

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = [int(input()) for _ in range(n)]

M = max(lis)

for i in range(n):
    if lis[i] == M:
        lis2 = lis[:i] + lis[(i+1):]
        print(max(lis2))
    else:
        print(M)


Fixed submission:
n = int(input())
lis = [int(input()) for _ in range(n)]
lis2 = sorted(lis)
m1 = lis2[-1]
m2 = lis2[-2]

for a in lis:
    if a == m1:
        print(m2)
    else:
        print(m1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
lis = list(map(int, input().split()))

M = max(lis)

for i in range(n):
    if lis[i] == M:
        lis2 = lis[:i] + lis[(i+1):]
        print(max(lis2))
    else:
        print(M)


Fixed submission:
n = int(input())
lis = [int(input()) for _ in range(n)]
lis2 = sorted(lis)
m1 = lis2[-1]
m2 = lis2[-2]

for a in lis:
    if a == m1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Runtime Error):
s = (input()

s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1, "")
    s2 = s[0]
    if s.count(s2) == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')


Fixed submission:
s = input()

s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1, "")
    s2 = s[0]
    if s.count(s2) == 2:
        print('Yes')
    else:
        print('No')

else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = str(input())

if str.count(s[0]) == str.count(s[1]) == str.count(s[2]) == str.count(s[3]) == 2:
    print('Yes')
else:
    print('No')


Fixed submission:
s = input()

s1 = s[0]
if s.count(s1) == 2:
    s = s.replace(s1, "")
    s2 = s[0]
    if s.count(s2) == 2:
        print('Yes')
    else:
        print('No')

else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

c = 0
for i in range(n-2):
    a = p[i:i+3]
    b = sorted.(a)
    if a[1] == b[1]:
        c += 1
print(c)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))

c = 0
for i in range(n-2):
    a = p[i:i+3]
    b = sorted(a)
    if a[1] == b[1]:
        c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

count = 0
for i in range(1,n-1):
    nums = p[(i-1):(i+1)]
    nums.sort()
    if p[i] == nums[1]
        count += 1
print(count)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))

c = 0
for i in range(n-2):
    a = p[i:i+3]
    b = sorted(a)
    if a[1] == b[1]:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
lis = list(map(int, input().split()))
lis2 = sorted(lis)
m1 = lis2[n/2-1]
m2 = lis2[n/2]

c = 0
for i in range((m1+1), (m2+1)):
    c += 1
print(c)


Fixed submission:
n = int(input())
lis = list(map(int, input().split()))
lis2 = sorted(lis)
m1 = lis2[n//2-1]
m2 = lis2[n//2]

c = 0
for i in range((m1+1), (m2+1)):
    c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a, p = map(int, input().split())

pis = (3a + p)//2
print(pis)

Fixed submission:
a, p = map(int, input().split())

pies = (3*a + p) // 2
print(pies)
Buggy python submission (verdict: Runtime Error):
n = int(input())
list1 = []
for i in range(n):
    s,p = input().split()
    p = int(p)
    list1.append([s, p, i+1])
list1.sort()
for i in list1:
    print[i[2]]


Fixed submission:
n = int(input())
list1 = []
for i in range(n):
    s,p = input().split()
    p = int(p)
    list1.append([s, -p, i+1])
list1.sort()
for i in list1:
    print(i[2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
list1 = []
for i in range(n):
    s,p = input().split()
    p = int(p)
    list1.append([s, p, i+1])
list.sort()
for i in list1:
    print[i[2]]


Fixed submission:
n = int(input())
list1 = []
for i in range(n):
    s,p = input().split()
    p = int(p)
    list1.append([s, -p, i+1])
list1.sort()
for i in list1:
    print(i[2])
Buggy python submission (verdict: Runtime Error):
r, d, x = map(int, input().split())

for i in range(10):
    x = (r * x) - D
    print(x)


Fixed submission:
r, d, x = map(int, input().split())

for i in range(10):
    x = (r * x) - d
    print(x)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()

print(s[:k-1] + s[k-1].lower() + s[k:])


Fixed submission:
a, b = map(int, input().split())
s = input()

print(s[:b-1] + s[b-1].lower() + s[b:])

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()

print(s[0:k-1] + s[k-1].lower() + s[k:a])


Fixed submission:
a, b = map(int, input().split())
s = input()

print(s[:b-1] + s[b-1].lower() + s[b:])

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()

print(s[0:k-1] + s[k-1].lower() + s[k, a])


Fixed submission:
a, b = map(int, input().split())
s = input()

print(s[:b-1] + s[b-1].lower() + s[b:])
Buggy python submission (verdict: Runtime Error):
a, b, t = map(int, input().split())
 
count = 0
for i range(1, t+1, a):
    count += i * b
print(count)

Fixed submission:
a, b, t = map(int, input().split())
 
count = 0
for i in range(0, t+1, a):
    count += b
print(count - b)

Buggy python submission (verdict: Runtime Error):
a, b, t = map(int, input().split())

count = 0
for i range(1, t+1, a):
  count += i * b
print(count)
  

Fixed submission:
a, b, t = map(int, input().split())
 
count = 0
for i in range(0, t+1, a):
    count += b
print(count - b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

#aとbで小さい方を返す
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

f_inf = float('inf')

dp = [f_inf] * (10**5+10)

dp[0] = 0

def rec(i):
    if dp[i] < f_inf:
        return dp[i]

    if i == 0:
        return 0

    res = f_inf
    res = chmin(res, rec(i-1) + abs(h[i] - h[i-1]))
    if i > 1:
        res = chmin(res, rec(i-2) + abs(h[i] - h[i-2]))

    dp[i] = res
    return res

ans = rec(n-1)
print(ans)


Fixed submission:
n = int(input())
h = list(map(int, input().split()))

#aとbで小さい方を返す
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

f_inf = float('inf')

dp = [f_inf] * (10**5+10)

dp[0] = 0

for i in range(1, n):
    dp[i] = chmin(dp[i], dp[i-1] + abs(h[i] - h[i-1]))

    if i > 1:
        dp[i] = chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

input = sys.stdin.readline

n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = dp.zeros(n, dtype=int)
h = np.array(h)

for i in range(1,n):
    start = max(0, i-k)
    dp[i] = min(dp[start: i] + np.abs(h[i] - h[start: i]))

print(dp[n-1])

Fixed submission:
import sys
import numpy as np

input = sys.stdin.readline

n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = np.zeros(n, dtype=int)
h = np.array(h)

for i in range(1,n):
    start = max(0, i-k)
    dp[i] = min(dp[start: i] + np.abs(h[i] - h[start: i]))

print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

#aとbで小さい方を返す
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

f_inf = float('inf')

dp = [f_inf] * (10**5+10)

dp[0] = 0

def rec(i):
    if dp[i] < f_inf:
        return dp[i]

    if i == 0:
        return 0

    res = f_inf
    res = chmin(res, rec(i-1) + abs(h[i] - h[i-1]))
    if i > 1:
        res = chmin(res, rec(i-2) + abs(h[i] - h[i-2]))

    dp[i] = res
    return res

ans = res(n-1)
print(ans)

Fixed submission:
import sys
import numpy as np

input = sys.stdin.readline

n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = np.zeros(n, dtype=int)
h = np.array(h)

for i in range(1,n):
    start = max(0, i-k)
    dp[i] = min(dp[start: i] + np.abs(h[i] - h[start: i]))

print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(i) for i in input().split()]

nums.sort_values(reverse=True)
print(sum(nums[0::2]) - sum(nums[1::2]))


Fixed submission:
n = int(input())
nums = [int(i) for i in input().split()]

nums.sort(reverse=True)
print(sum(nums[0::2]) - sum(nums[1::2]))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if (a * b) % 2 == 0
    print("Even")
else:
    print("Odd")


Fixed submission:
a, b = map(int, input().split())

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a * b % 2 == 0
    print("Even")
else:
    print("Odd")


Fixed submission:
a, b = map(int, input().split())

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a * b % 2 = 0
    print("Even")
else:
    print("Odd")


Fixed submission:
a, b = map(int, input().split())

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(input()) for _ in range(int(input()))]
print(len(set(nums)))


Fixed submission:
nums = [int(input()) for _ in range(int(input()))]
print(len(set(nums)))