Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03574 (python)

Fixed submission:
h,w = map(int,input().split())
s = []
for i in range(h):
    s.append(list(input()))

dx = [-1,0,1,-1,1,-1,0,1]
dy = [1,1,1,0,0,-1,-1,-1]

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            continue
        cnt = 0
        for t in range(8):
            ni=i+dx[t]
            nj=j+dy[t]
            if ni<0 or h<=ni: continue
            if nj<0 or w<=nj: continue
            if s[ni][nj] == '#':
                cnt += 1
        
        s[i][j] = str(cnt)

for i in s:
    print(''.join(i))

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
s = []
for i in range(h):
    s.append(list(input()))

dx = [-1,0,1,-1,1,-1,0,1]
dy = [1,1,1,0,0,-1,-1,-1]

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            continue
        cnt = 0
        for t in range(8):
            ni=i+dx[t]
            nj=j+dy[t]
            if ni<0 or h<=ni: continue
            if nj<0 or h<=nj: continue
            if s[ni][nj] == '#':
                cnt += 1
        
        s[i][j] = str(cnt)

for i in s:
    print(''.join(i))
Problem p03699 (python)

Fixed submission:
n=int(input())
tens=[]
others=[]
for i in range(n):
    s=int(input())
    if s%10==0:
        tens.append(s)
    else:
        others.append(s)
tens.sort(reverse=True)
others.sort(reverse=True)

score=sum(tens)+sum(others)
if score%10==0:
    if len(others)!=0:
        print(score-min(others))
    else:
        print(0)
else:
    print(score)

Buggy submission (verdict: Runtime Error):
n=int(input())
tens=[]
others=[]
for i in range(n):
    s=int(input())
    if s%10==0:
        tens.append(s)
    else:
        others.append(s)
tens.sort(reverse=True)
others.sort(reverse=True)

score=sum(tens)+sum(others)
if score%10==0:
    print(score-min(others))
else:
    print(score)
Problem p03720 (python)

Fixed submission:
n,m=map(int,input().split())
d={}
for i in range(n):
    d[i]=0
for i in range(m):
    a,b=map(int,input().split())
    d[a-1]+=1
    d[b-1]+=1
for i in range(n):
    print(d[i])

Buggy submission (verdict: Runtime Error):
from itertools import combinations
import math
n,d=map(int,input().split())
X=[list(map(int,input().split())) for _ in range(n)]
cnt=0
for perm in list(combinations(range(n),2)):
    d=sum(map(lambda x: (x[0]-x[1])**2,zip(X[perm[0]],X[perm[1]])))
    if d==int(math.sqrt(d))**2:
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
d={}
for i in range(5):
    d[i]=0
for i in range(m):
    a,b=map(int,input().split())
    d[a-1]+=1
    d[b-1]+=1
for i in range(n):
    print(d[i])
Problem p04033 (python)

Fixed submission:
a,b=map(int,input().split())
if a>=0:
    print("Positive" if a!=0 else "Zero")
if a<0 and b>0:
    print("Zero")
if b<=0:
    if b==0:
        print("Zero")
    else:
        if (a-b+1)%2==0:
            print("Positive")
        else:
            print("Negative")

Buggy submission (verdict: Runtime Error):
a,b=map(int,inout().split())
if a>=0:
    print("Positive" if a!=0 else "Zero")
if a<0 and b>0:
    print("Zero")
if b<=0:
    if b==0:
        print("Zero")
    else:
        if (a-b+1)%2==0:
            print("Positive")
        else:
            print("Negative")
Problem p02536 (python)

Fixed submission:
def root(list_parent, x):
    if(list_parent[x] == x):
        return x
    else:
        list_parent[x] = root(list_parent, list_parent[x])
        return list_parent[x]

def unite(list_parent, x, y):
    x = root(list_parent, x)
    y = root(list_parent, y)

    if(x == y):
        return list_parent

    if x > y:
        list_parent[y] = x
    else:
        list_parent[x] = y

    return list_parent

def main():
    N, M = map(int, input().split())

    list_parent = []
    for i in range(N):
        list_parent.append(i)

    for i in range(M):
        A, B = map(int, input().split())
        list_parent = unite(list_parent, A-1, B-1)

    set_root = set()
    for i in list_parent:
        root_i = root(list_parent, i)
        if root_i not in set_root:
            set_root.add(root_i)

    print(len(set_root) - 1)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    connect_list = [0] * N

    for i in range(M):
        A, B = map(int, input().split())
        
        A_road_num = connect_list[A]
        B_road_num = connect_list[B]

        if A_road_num == 0 and B_road_num == 0:
            max_road_num = max(connect_list)
            connect_list[A] = max_road_num
            connect_list[B] = max_road_num
        elif A_road_num != 0 and B_road_num == 0:
            connect_list[B] = connect_list[A]
        elif A_road_num == 0 and B_road_num != 0:
            connect_list[A] = connect_list[B]
        else:
            connect_list = [A_road_num if B_road_num == road_num else road_num for road_num in connect_list]

    answer = 0
    set_connect_list = set([i for i in connect_list if i > 0])
    if len(set_connect_list) != 1:
        answer = len(set_connect_list) - 1

    print(answer + connect_list.count(0))

if __name__ == "__main__":
    main()
Problem p02866 (python)

Fixed submission:
def main():
    N = input()
    D_list = list(map(int, input().split()))

    if D_list[0] != 0:
        ans = 0
    
    else:
        maxD = max(D_list)
        count_ele_Dlist = [0] * (maxD + 1)

        for i in D_list:
            count_ele_Dlist[i] = count_ele_Dlist[i] + 1

        if count_ele_Dlist[0] == 1:
            ans = 1
            for i in range(1, maxD + 1):
                ans = (ans * count_ele_Dlist[i - 1] ** count_ele_Dlist[i]) % 998244353
        else:
            ans = 0
        
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
D = list(map(int,input().split()))
M = max(D)
countlist=[0] * M
ans=1

for i in D:
    countlist[i]+=1

if countlist[0]!=1 :
    print(0)
    sys.exit()

if D[0]!=0 :
    print(0)
    sys.exit()

for i in range(2,M+1):
    ans *= countlist[i-1]**countlist[i]

print(ans%998244353)

Buggy submission (verdict: Runtime Error):
def main():
    N = input()
    D_list = list(map(int, input().split()))

    maxD = max(D_list)
    count_nowD = D_list.count(0)
    lenD = len(count_nowD)

    if D_list.count(0) == 0:
        ans = 0
    elif count_nowD == lenD:
        ans = 1
    else:
        counter = 1
        ans = 1

        while counter <= maxD:
            count_beforeD = count_nowD
            count_nowD = D_list.count(counter)

            if(count_nowD == 0):
                ans = 0
                break

            ans = (ans * (count_beforeD ** count_nowD) % 998244353) % 998244353
            counter = counter + 1

    print(ans)

if __name__ == "__main__":
    main()
Problem p03238 (python)

Fixed submission:
print("Hello World") if(input() == "1") else print(int(input()) + int(input()))

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            result = H - abs(cx - input_list[0]) -  abs(cy - input_list[1])
            if (result < 0) or (input_list[2] != result):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(0)

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            result = H - abs(cx - input_list[0]) - abs(cy - input_list[1])
            if (result >  0) and (input_list[2] != result):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(0)

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            if (input_list[2] != (H - abs(cx - input_list[0]) - abs(cy - input_list[1])):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(0)
Problem p03240 (python)

Fixed submission:
from math import *

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x_y_h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        flag = 1
        H = x_y_h[2] + abs(cx - x_y_h[0]) + abs(cy - x_y_h[1])
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                flag = 0
                break
        if (flag == 1):
            print("%s %s %s" % (cx, cy, H))
            break
    if (flag == 1):
        break

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = sorted(all_input_list, key=lambda x: x[2])[-1]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(1)

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = sorted(all_input_list, key=lambda x: x[2])[-1]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(1)

Buggy submission (verdict: Runtime Error):
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
all_input_list.sort(key=lambda x: x[2])
x,y,h = all_input_list[-1]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            if (input_list[2] != max(H - abs(cx - input_list[0]) - abs(cy - input_list[1]), 0)):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(1)
Problem p03241 (python)

Fixed submission:
from math import *

def main():
    N, M = map(int, input().split())
    if N==1:
        print(M)
        return
    special_value = M//N
    divisor_set = set(i for i in range(1, (int(sqrt(M)) + 1)) if (M % i == 0))
    divisor_set = divisor_set.union(M/j for j in divisor_set)
    print(int(max([i for i in divisor_set if special_value >= i])))
    return

main()

Buggy submission (verdict: Runtime Error):
from math import *

def main():
    N, M = map(int, input().split())
    special_value = M//N
    divisor_set = set(i for i in range(1, (int(sqrt(M)) + 1)) if (M % i == 0))
    divisor_set = divisor_set.union(M//j for j in divisor_set)
    print(int(max(divisor_set, key=lambda x: x if special_value >= x else -1)))

    return

if __name__ == "__main__":
main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**10)

def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)

def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

Buggy submission (verdict: Runtime Error):
def search_max_gcd(M, possible):
    if possible == 1:
        return 1
    elif (M % possible) == 0:
        return possible
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()

Buggy submission (verdict: Runtime Error):
def search_max_gcd(M, possible):
    if (M % possible) == 0:
        return possible
    elif possible == 1:
        return 1
    else:
        return search_max_gcd(M, possible-1)

def main():
    N, M = map(int, input().split())
    first_possible = M//N
    print(search_max_gcd(M, first_possible))

main()
Problem p03244 (python)

Fixed submission:
from collections import *

N = int(input())
v_list = input().split()

if len(set(v_list)) == 1:
    print(len(v_list) // 2)
    exit()

v1_list = v_list[::2]
v2_list = v_list[1::2]

v1_count_list = Counter(v1_list).most_common()
v2_count_list = Counter(v2_list).most_common()

if v1_count_list[0][0] != v2_count_list[0][0]:
    print(len(v_list) - v1_count_list[0][1] - v2_count_list[0][1])
else:
    countor1 = len(v_list) - v1_count_list[1][1] - v2_count_list[0][1]
    countor2 = len(v_list) - v1_count_list[0][1] - v2_count_list[1][1]
    print(min(countor1, countor2))

Buggy submission (verdict: Runtime Error):
N = int(input())
v_list = input().split()

if len(set(v_list)) == 1:
    print(len(v_list) // 2)
    exit()

v1_dict = {}
v2_dict = {}

for i, num in enumerate(v_list):
    if i%2 == 0:
        v1_dict[num] = v1_dict[num] + 1 if num in v1_dict else 0
    else:
        v2_dict[num] = v2_dict[num] + 1 if num in v2_dict else 0

v1_dict = sorted(v1_dict.items(), key=lambda x: -(len(v1_dict) - x[1]))
v2_dict = sorted(v2_dict.items(), key=lambda x: -(len(v2_dict) - x[1]))

if v1_dict[0][0] != v2_dict[0][0]:
    ans = v1_dict[0][1] + v2_dict[0][1]
elif max_value_v1 > max_value_v2:
    ans = v1_dict[1][1] + v2_dict[0][1]
else:
    ans = v1_dict[0][1] + v2_dict[1][1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
v_list = input().split()

if len(set(v_list)) == 1:
    print(len(v_list) // 2)
    exit()

v1_dict = {}
v2_dict = {}

for i, num in enumerate(v_list):
    if i%2 == 0:
        v1_dict[num] = v1_dict[num] + 1 if num in v1_dict else 0
    else:
        v2_dict[num] = v2_dict[num] + 1 if num in v2_dict else 0

v1_dict = sorted(v1_dict.items(), key=lambda x: -x[1])
v2_dict = sorted(v2_dict.items(), key=lambda x: -x[1])

if v1_dict[0][0] != v2_dict[0][0]:
    ans = v1_dict[0][1] + v2_dict[0][1]
elif max_value_v1 > max_value_v2:
    ans = v1_dict[1][1] + v2_dict[0][1]
else:
    ans = v1_dict[0][1] + v2_dict[1][1]
print(ans)
Problem p02553 (python)

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

if b<0 and d<0:
    print(a*c)
elif a>=0 and c>=0:
    print(b*d)
elif b<0 and c>=0:
    print(b*c)
elif a>=0 and d<0:
    print(a*d)
else:
    if a*c>=b*d:
        print(a*c)
    else:
        print(b*d)

Buggy submission (verdict: Runtime Error):
if a<0 and c<0:
    print(a*c)
elif b>=0 and d>=0:
    print(b*d)
elif b<0 and c>=0:
    print(b*c)
elif a>=0 and d<0:
    print(a*d)
else:
    if a*c>=b*d:
        print(a*c)
    else:
        print(b*d)
Problem p02934 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0.0
for i in range(n):
  ans=ans+1.0/a[i]
ans=1.0/ans
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  ans=ans+1/a[i]
ans=1/ans
 print(ans)
Problem p02677 (python)

Fixed submission:
#-*-coding:utf-8-*-

import math

def calculate_length(A,B,rad):
    length=(A**2)+(B**2)-(2*A*B*math.cos(math.pi*rad/180))
    return  math.sqrt(length)

def main():
    A,B,H,M = map(int,input().split())
    rad = abs((H*60+M)*0.5-M*6)
    length=calculate_length(A,B,rad)
    print(length)

if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
#-*-coding:utf-8-*-

import math

def calculate_length(A,B,theta):
    radian=math.radians(theta)
    length=(A**2)+(B**2)-(2*A*B*math.cos(radian))
    return  math.sqrt(length)

def main():
    A,B,H,M = map(int,input().split())
    thetaA=H*30+M*0.5
    thetaB=M*6
    if thetaA > thetaB:
        theta=thetaA-thetaB
    elif thetaA < thetaB:
        theta = thetaB-thetaA
    else:
        print("0")
    length=calculate_length(A,B,theta)
    print(length)

if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
#-*-coding:utf-8-*-

import math

def calculate_length(A,B,theta):
    radian=math.radians(theta)
    length=(A**2)+(B**2)-(2*A*B*math.cos(math.radians(theta)))
    return  math.sqrt(length)

def main():
    A,B,H,M = map(int,input().split())
    thetaA=H*30+M*0.5
    thetaB=M*6
    if thetaA> thetaB:
        theta=thetaA-thetaB
    elif thetaA < thetaB:
        theta = thetaB-thetaA
    elif thetaA==thetaB:
        print("0")
    length=calculate_length(A,B,theta)
    print(length)

if __name__=="__main__":
    main()
Problem p02818 (python)

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

if k <= a:
    print(str(a-k),str(b))
elif k <= a+b:
    print(str(0),str(b-(k-a)))
else:
    print(str(0),str(0))

Buggy submission (verdict: Runtime Error):
import sys

def check(a,b,k):
    if a + b == k:
        b = 0
        a = 0
    elif a < k:
        b = b - (k-a)
        a = 0
    elif a > k:
        a = a - k
    return a,b

a,b,k=map(int,input().split(" "))
if len(str(a)) > 12 or len(str(b)) > 12 or len(str(k)) > 12:
  a=0
  b=0
  print(str(a),str(b))
  sys.exit()

else:
    if a > 0 and k > 0:
        A,B=check(a,b,k)
        print(str(A), str(B))
    elif a == 0 and b > k:
        b = b-k
        print(str(a), str(b))
    elif a+b < K:
        b = 0
        a = 0
        print(str(a), str(b))
    elif k ==0:
        print(str(a),str(b))

Buggy submission (verdict: Runtime Error):
import sys

def check(a,b,k):
    if a + b == k:
        b = 0
        a = 0
    elif a < k:
        b = b - (k-a)
        a = 0
    elif a > k:
        a = a - k
    return a,b

a,b,k=map(int,input().split(" "))
if len(str(a)) > 12 or len(str(b)) > 12 or len(str(k)) > 12:
  a=0
  b=0
  print(str(a),str(b))
  sys.exit()

else:
    if a > 0 or k > 0:
        A,B=check(a,b,k)
    elif a <= 0 and b > 0:
        b = k -b
    print(str(A),str(B))
Problem p02823 (python)

Fixed submission:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n,a,b = map(int,input().split())
    ans=0
    if (b-a) % 2 == 0:
        print((b-a) // 2)
    else:
        print((b-a)//2 + min(a-1,n-b) + 1)

if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n,a,b = map(int,input().split())
    if a==b:
        print(0)
    elif a==1:
        print(str(b-1))
    elif b==1:
        print(str(a-1))
    elif a==n:
        print(str(b+1))
    elif b==n:
        print(str(a+1))
    else:
        if abs(a-b)%2==0:
            ans=abs(a-b)//2
        else:
            if n-min(a,b)>=max(a,b)-1:
                ans=max(a,b)-1
            else:
                ans=n-min(a,b)
    print(ans)

if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n,a,b = map(int,input().split())

    if a==b:
        print(0)
    elif a==1:
        print(str(b))
    elif b==1:
        print(str(a))
    else:
        if abs(a-b)%2==0:
            ans=abs(a-b)//2
        else:
            if n-min(a,b)>max(a,b)-1:
                ans=max(a,b)-1
            else:
                ans=n-min(a,b)
    print(ans)

if __name__=="__main__":
    main()
Problem p02886 (python)

Fixed submission:
from copy import deepcopy

if __name__ == "__main__":
    num = int(input())
    base_list=[]
    tmp_list=[]
    ans=0
    base_list = input().split()
    tmp_list = deepcopy(base_list)
    for i in base_list:
        tmp_list.remove(i)
        for j in tmp_list:
            ans+=int(i)*int(j)
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    num = int(input())
    base_list=[]
    tmp_list=[]
    ans=0
    base_list = input().split()
    tmp_list = deepcopy(base_list)
    for i in base_list:
        print("i:"+i)
        tmp_list.remove(i)
        for j in tmp_list:
            ans+=int(i)*int(j)
    print(ans)
Problem p03160 (python)

Fixed submission:
#-*-coding:utf-8-*-

import sys

def distance(ashiba,i,j):
    return abs(ashiba[i]-ashiba[j])    

def main():
    N = int(input())
    ashiba = list([int(i) for i in input().split()])
    cost_list=[]
    cost1=0
    cost2=0

    for i in range(N):
        if i==0:
            cost_list.append(0)
        elif i==1:
            cost1 = distance(ashiba,i,i-1)
            cost_list.append(cost1)
        else:
            cost1=distance(ashiba,i,i-1)
            cost2=distance(ashiba,i,i-2)
            cost=min(cost1+cost_list[i-1],cost2+cost_list[i-2])
            cost_list.append(cost)
    print(cost_list[-1])

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#-*-coding:utf-8-*-

import numpy as np

def main():
    n = int(input())
    ashiba=np.array((input().split()),int)
    dp=np.zeros(n,dtype=int)
    k=2
    for i in range(1,n):
        start=max(0,i-k)
        dp[i]=min(dp[start:i]+abs(ashiba[i]-ashiba[start:i]))
    print(dp[N-1])

if __name__ == "__main__":
    main()