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

Fixed submission:
import sys
sys.setrecursionlimit(10000)
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
if n == 1:
    print(int(input()))
    sys.exit()
t = [int(input()) for i in range(n)]
check = t[0]*t[1]//gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]//gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))

Buggy submission (verdict: Runtime Error):
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))

Buggy submission (verdict: Runtime Error):
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
    check = check*t[i+2]/gcd(check,t[i+2])
print(int(check))
Problem p03238 (python)

Fixed submission:
n = int(input())


if n == 1:
    print("Hello World")

elif n == 2:

     a = int(input())
     b = int(input())

     c = a + b
     print(c)

Buggy submission (verdict: Runtime Error):
#

array = list(map(int, input().strip().split(' ')))


N =  array[0]

T =  array[1]


#print(N)
#print(T)

if N < 1:
    sys.exit()

if N > 100:
    sys.exit()


if T < 1:
    sys.exit()

if T > 1000:
    sys.exit()



c_min = 9999


for i in range(N):
    array1 = list(map(int, input().strip().split(' ')))
    cN =  array1[0]

    tN =  array1[1]

    if cN < 1:
        sys.exit()

    if cN > 1000:
        sys.exit()

    if tN < 1:
        sys.exit()

    if tN > 1000:
        sys.exit()
    
    if tN <= T:
        if c_min > cN:

            c_min = cN

if c_min == 0:
    print("TLE")

else:
    print(c_min)

Buggy submission (verdict: Runtime Error):
#

array = list(map(int, input().strip().split(' ')))


N =  array[0]

T =  array[1]


#print(N)
#print(T)

if N < 1:
    quit()

if N > 100:
    quit()


if T < 1:
    quit()

if T > 1000:
    quit()




c_min = 9999


for i in range(N):
    array1 = list(map(int, input().strip().split(' ')))
    cN =  array1[0]

    tN =  array1[1]

    if cN < 1:
        quit()

    if cN > 1000:
        quit()

    if tN < 1:
        quit()

    if tN > 1000:
        quit()

    if tN <= T:
        if c_min > cN:

            c_min = cN

if c_min == 0:
    print("TLE")

else:
    print(c_min)
Problem p03035 (python)

Fixed submission:
a, b = [int(a) for a in input( ).split()]
if b%2==0:
  if a>=13:
    print(b)
  elif a>=6 and a<=12:
    print(int(b/2))
  elif a<=5:
    print(0)

Buggy submission (verdict: Runtime Error):
a = int(input("")
b = int(input("")
if b%2==0:
        if a>=13:
          print(b)
        elif 6<=a<=12:
          print(b/2)
        elif a<=5:
          print(0)

Buggy submission (verdict: Runtime Error):
a = int(input(""))
b = int(input(""))
if b % 2==0:
   if a>=13:
          print(b)
   elif 6<=a<=12:
          print(b/2)
   elif a<=5:
          print(0)
Problem p02838 (python)

Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
for i in range(ceil(log2(max(a)))):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = [int(i) for i in input().split()]
s = 0
c = 1
for i in range(int(math.log2(max(A))+1)):
    #print(max(A))
    s0 = 0
    s1 = 0
    for i,j in enumerate(A):
        A[i],mod = divmod(j,2)
        if mod==1:
            s1 +=1
        else:
            s0 +=1
    s = (s+(s0*s1*c)%(10**9+7))%(10**9+7)
    c *= 2
print(s)
Problem p02898 (python)

Fixed submission:
N,K=[int(i) for i in input().split()]
h = [int(i) for i in input().split()]
smy = 0
 
for i in h:
  if not(i<K):
    smy+=1
print(smy)

Buggy submission (verdict: Runtime Error):
N,K=[int(i) for i in input().split()]
h = [int(i) for i in input().split()]
smy = 0

for i in h:
  if !(h<K):
    smy+=1:
print(smy)
Problem p02921 (python)

Fixed submission:
a = input()
b = input()
count = 0
for i in range(3):
  if a[i] == b[i]:
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
a = int(input())

print(a*(a-1)//2)
Problem p03160 (python)

Fixed submission:
INF =10001
N = int(input())
h = [int(i) for i in input().split()]
i = 2
dp = [INF for i in range(N)]
dp[0],dp[1] = 0,abs(h[1]-h[0])

while not i==N:
    dp[i] = min(dp[i-2]+abs(h[i] - h[i-2]),dp[i-1]+abs(h[i] - h[i-1]))
    i+=1
    
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
INF =10001
N = int(input())
K = 2
h = [int(i) for i in input().split()]
i = 2
dp = [INF for i in range(N)]
dp[0],dp[1] = 0,abs(h[1]-h[0])
 
while not i==N:
	l = min(len(dp[:i]),K)
    dp[i] = min([dp[i-j]+abs(h[i] - h[i-j]) for j in range(1,l)])
    i+=1
    
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
INF =10001
N = int(input())
h = [int(i) for i in input().split()]
i = 2
dp = [INF for i in range(N)]
dp[0],dp[1] = 0,abs(h[1]-h[0])
 
while i<N:
    dp[i] = min(dp[i],dp[i-1]+abs(h[i] - h[i-1]))
    dp[i] = min(dp[i],dp[i-2]+abs(h[i] - h[i-2]))
    i+=1
    
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
h = [int(i) for i in input().split()]
h = h[::-1] +[1,-1]
#print(h)
i=0
count=0
while True:
    if h[i+1]*h[i+2]<1:
        break
    a=abs(h[i+1]-h[i])
    b=abs(h[i+2]-h[i])
    if a<b:
        i+=1
        count+=a
    else:
        i+=2
        count+=b
print(count)
Problem p03161 (python)

Fixed submission:
def test():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    dp = [float('inf')]*N
    dp[0] = 0
 
    for i in range(1, N):
        dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))
 
    print(dp[-1])
 
if __name__ == '__main__':
    test()

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
 
 
for i in range(1,N):
  dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
 
 
for i in range(1,N):
  dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
 
 
for i in range(1,N):
    dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
 
 
for i in range(1,N):
    dp[i] = min(dp[i-j]+abs(h[i] - h[i-j]) for j in range(1,min(K,i)))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0


for i in range(1,N):
    l = min(K,i)
    data = []
    dp[i] = min(data, dp[i-j]+abs(h[i] - h[i-j]) for j in range(1,l+1))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0


for i in range(1,N):
    l = min(K,i)
    data = []
    dp[i] = min(data, dp[i-j]+abs(h[i] - h[i-j])) for j in range(1,l+1)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import heapq


N = int(input())
h = [int(i) for i in input().split()]
i = 1
dp = [0 for i in range(N)]
K = 2
 
while not i==N:
    l = min(K,i)
    data = []
    for j in range(1,l+1):
        heapq.heappush(data, dp[i-j]+abs(h[i] - h[i-j]))
    dp[i] = heapq.heappop(data)
    i+=1
    
print(dp[N-1])
Problem p02639 (python)

Fixed submission:
a,b,c,d,e=(int(x) for x in input().split())
if a==0:
    print('1')
elif b==0:
    print('2')
elif c==0:
    print('3')
elif d==0:
    print('4')
elif e==0:
    print('5')

Buggy submission (verdict: Runtime Error):
x,y=(int(x) for x in input().split())
a=[int(x) for x in input().split()]
1<=x<=100
0<=y<=100
while y>0:
    if y in a:
        z=y+1
    elif not y in a:
        print('y')
        break
    elif z in a:
        z+=1
    else:
        break
while y<100:
    if y in a:
        b=y-1
    elif b in a:
        b+=1
    else:
        break
c=z-y
d=b-y
if not y in a:
    pass
elif abs(c)<abs(d):
    print(c)
else:
    print(d)

Buggy submission (verdict: Runtime Error):
x,y=(int(x) for x in input().split())
if y>x*4:
    print('No')
elif y<x*2:
    print('No')
elif y%2==1:
    print('No')
else:
    print('Yes')
Problem p02645 (python)

Fixed submission:
import random
S=input()
3<=len(S)<=20
x=random.randint(3,len(S))
y=x-3
print(S[y:x])

Buggy submission (verdict: Runtime Error):
a,v=input().split()
b,w=input().split()
t=int(input())
A=int(a)
B=int(b)
W=int(w)
V=int(v)
-10^9<=A,B<=10^9
1<=V,W<=10^9
1<=t<=10^9
A!=B
x=B-A
y=V-W
z=y/x
if z<=t:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,v=input().split()
b,w=input().split()
t=int(input())
a=int(a)
b=int(b)
c=int(v)
d=int(w)
-10^9<=a,b<=10^9
1<=v,w<=10^9
1<=t<=10^9
a!=b
x=b-a
y=v-w
z=y/x
if z<=t:
    print('YES')
else:
    print('NO')
Problem p02658 (python)

Fixed submission:
def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A:
        print(0) 
        return
    
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return

    print(prod)
    
multipilation()

Buggy submission (verdict: Runtime Error):
def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A
        print(0) 
        return
    
    prod = 1
    for a in A
        prod *= a
        if prod > 1000000000000000000
            print(-1)
            return

    print(prod)
    
multipilation()

Buggy submission (verdict: Runtime Error):
def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A
        print(0) 
        return
    
    prod = 1
    for a in A
        prod *= a
        if prod > 10**18
            print(-1)
            return

    print(prod)
    
multipilation()

Buggy submission (verdict: Runtime Error):
def multipilation():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A
        print(0) 
        return
    
    prod = 1
    for a in A
        prod *= a
        if prod > 10**18
            print(-1)
            return

    print(prod)
    
    multipilation()
Problem p02842 (python)

Fixed submission:
import math
N = int(input())

for i in range(N+1):
    if math.floor(1.08 * i) == N:
        print(i)
        exit()

print(":(")

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
for i in N+1:
    if math.floor(i*1.08) = N
    print(i)
    exit()
    
print(":(")

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
for i in N+1
    if math.floor(i*1.08) = N
    print(i)
    exit()
    
print(":(")
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
calc = 0
ans = 0

for i in range(N):
    A = list(map(int,input().split()))
    calc = 0
    for j in range(M):
        calc += A[j] * B[j]

    if calc + C > 0:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N):
    A = list(map(int, input().split()))
calc = 0
for i in range(M):
    calc = A[i] * B[i]
    if C + calc > 0:
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N)
    A = list(map(int, input().split()))

for i in range(M):
    calc = A[i] * B[i]
    if C + calc > 0:
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N)
    A = list(map(int, input().split()))

for i in range(M):
    calc = A[i] * B[i]
    if C + calc > 0
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N)
    A = list(map(int, input().split()))

for i in range(M):
    calc = A[i] * B[i]
    if C + calc > 0
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N, M, C = int(input())
B = list(map(int, inpot().split()))
count = 0
for j in range(N)
    A = list(map(int, input().split()))

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

print(count)
Problem p03434 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(N):
    if a[i] % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input()))
a.sort(reverse=True)
ans = 0
for i in range(N):
    if a[i] % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]

print(ans)
Problem p02640 (python)

Fixed submission:
kazu, ashi = map(int, input().split())
tsuru, kame = 0, 0
hantei = 0

for i in range(kazu+1):
    kame = i
    tsuru = kazu - i
    if kame * 4+ tsuru * 2 == ashi:
        hantei = 1
        break

if hantei:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
kazu, ashi = map(int, input().split())

if (ashi - 2*kazu) % 2 == 0:
    kame = (ashi - 2*kazu) // 2
else:
    print("No")
if kazu - kame >= 0 and kame >= 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
kazu, ashi = map(int, input().split())

if (ashi - 2*kazu) % 2 == 0:
    kame = (ashi - 2*kazu) // 2
else:
    print("No")
if kazu - kame >= 0:
    print("Yes")
else:
    print("No")
Problem p02657 (python)

Fixed submission:
m, n = map(int, input().split())
print(m * n)

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

print(m*n)
Problem p02658 (python)

Fixed submission:
#!/usr/bin/env python3
n = int(input())

arg = list(map(int, input().split()))
ans = 1

if 0 in arg:
    ans = 0
else:
    for m in arg:
        ans *= m

        if ans > 1000000000000000000:
            ans = -1
            break

print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
from decimal import Decimal

n = int(input())

arg = list(map(Decimal, input().split()))
ans = Decimal("1")

for m in arg:
    ans = ans * m

if ans > Decimal("1000000000000000000"):
    ans = -1
    
print(ans)
Problem p03610 (python)

Fixed submission:
s = input()
ans = ""
for i in range(0, len(s), 2):
    ans += s[i]

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = ""
for i in range(1:: 2):
    ans += s[i]

print(ans)
Problem p02789 (python)

Fixed submission:
a, b = map(int, input().split())
if b/a==1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a/b==1:
    print("Yes")
else:
    print("No")
Problem p02812 (python)

Fixed submission:
a = int(input())
b = str(input())
c = b.count("ABC")
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = str(input())
c = 0
for i in range(0, a):
    if (b[i] == "A") and (b[i+1] == "B") and (b[i+2] == "C"): c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = str(input())
c = 0
for i in range(0, a):
    if (b[i] == "A") and (b[i+1] == "B") and (b[i+2] == "C"):
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = str(input())
c = 0
for i in range(0, a):
    if (b[i] == "A") and (b[i+1] == "B") and (b[i+2] == "C"):
        c+=1
print(c)
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]

A = [-1] * N
ok= True
for s, c in SC:
    i = s-1
    if A[i] != -1 and A[i] != c:
        ok = False
        break
    A[i] = c
if N > 1 and A[0]==0:
    ok = False
if ok:
    for i in range(N):
        if A[i] == -1:
            if i == 0 and N != 1:
                A[i] = 1
            else:
                A[i] = 0
if ok:
    print(''.join(map(str, A)))
else:    
    print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]

A = [-1] * N
ok= True
for s, c in SC:
    i = s-1
    if A[i] != -1 and A[i] != c:
        ok = False
        break
    A[i] = c
if N > 1 and A[0]==0:
    ok = False
if ok:
    for i in range(N):
        if A[i] == -1:
            if i == 0 && N != 1:
                A[i] = 1
            else:
                A[i] = 0
if ok:
    print(''.join(map(str, A)))
else:    
    print(-1)
Problem p02845 (python)

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

ans = 1
rgb = [0, 0, 0]
for i in range(N):
    c = rgb.count(A[i])
    if c == 0:
        ans = 0
        break
    p = rgb.index(A[i])
    ans *= c
    rgb[p] += 1

print(ans % M)

Buggy submission (verdict: Runtime Error):
M = 1000000007
N = int(input())
A = list(map(int, input().split()))

ans = 1
rgb = [0, 0, 0]
for i in range(N):
    c = rgb.count(A[i])
    p = rgb.index(A[i])
    ans *= c
    rgb[p] += 1

print(ans % M)
Problem p03112 (python)

Fixed submission:
from bisect import bisect_left

INF = 2 * 10**10

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]
ans = []
for x in X:
    sr = bisect_left(S, x) 
    sl = sr -1
    if sr != len(S) and S[sr] == x:
        sl = sr
    tr = bisect_left(T, x)
    tl = tr - 1
    if tr != len(T) and T[tr] == x:
        tl = tr

    ll = INF if sl == -1 or tl == -1 else x - min(S[sl], T[tl])
    rr = INF if sr == len(S) or tr == len(T) else max(S[sr], T[tr]) - x
    lsrt = INF if sl == -1 or tr == len(T) else 2*(x-S[sl]) + (T[tr] - x)
    ltrs = INF if tl == -1 or sr == len(S) else 2*(x-T[tl]) + (S[sr] - x)
    rslt = INF if tl == -1 or sr == len(S) else 2*(S[sr] - x) + (x - T[tl])
    rtls = INF if sl == -1 or tr == len(T) else 2*(T[tr] - x) + (x - S[sl])

    ans.append(min(ll, rr, lsrt, ltrs, rslt, rtls))
print(*ans, sep='\n')

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left

INF = 2 * 10**10

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]

for x in X:
    sr = bisect_left(S, x) 
    sl = sr -1
    if sr != len(S) and S[sr] == x:
        sl = sr
    tr = bisect_left(T, x)
    tl = tr - 1
    if tr != len(T) and T[tr] == x:
        tl = tr

    ll = INF if sl == -1 or tl == -1 else x - min(S[sl], T[tl])
    rr = INF if sr == len(S) or tl == len(T) else max(S[sr], T[tr]) - x
    lsrt = INF if sl == -1 or tr == len(T) else 2*(x-S[sl]) + (T[tr] - x)
    ltrs = INF if tl == -1 or sr == len(S) else 2*(x-T[tl]) + (S[sr] - x)
    rslt = INF if tl == -1 or sr == len(S) else 2*(S[sr] - x) + (x - T[tl])
    rtls = INF if sl == -1 or tr == len(T) else 2*(T[tr] - x) + (x - S[sl])

    ans = min(ll, rr, lsrt, ltrs, rslt, rtls)
    print(ans)
Problem p03160 (python)

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

inf = 2**63-1
dp = [inf] * (n+1)
dp[1] = 0

for i in range(1, n):
    if i+1 <= n:
        dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1-1]-h[i-1]))
    if i+2 <= n:
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2-1]-h[i-1]))

print(dp[n])

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
struct _I { _I() {cin.tie(0);ios::sync_with_stdio(false);}} __I;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class F, class S> istream& operator >> (istream& s, pair<F, S>& p)
{ cin >> p.first >> p.second; return s;}
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_h(const vector<T>& c, int n=INT_MAX)
{ rep(i, min(n, (int)c.size())) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
#define D1(a) cout<<#a<<":"<<a<<"\n"
#define D2(a,b) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<endl 
#define D3(a,b,c) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c <<endl
#define D4(a,b,c,d) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c<<","<<#d<<":"<<d<<endl 
#define MOD 1000000007

int main()
{
    ll N; cin >>N;
    vector<ll> h(N); cin >> h;
    
    vll dp(N+1, LLONG_MAX);
    dp[1] = 0;

    for (int i = 1; i < N; i++) {
        if (i + 1 <= N)
            dp[i+1] = min(dp[i+1], dp[i] + abs(h[i-1]- h[i]));
        if (i + 2 <= N)
            dp[i+2] = min(dp[i+2], dp[i] + abs(h[i-1]- h[i+1]));
    }

    cout << dp[N] << endl;
}
Problem p02600 (python)

Fixed submission:
a=int(input())

if a >= 400 and a < 600:
    print("8")
elif a >= 600 and a < 800:
    print("7")
elif a >= 800 and a < 1000:
    print("6")
elif a >= 1000 and a < 1200:
    print("5")
elif a >= 1200 and a < 1400:
    print("4")
elif a >= 1400 and a < 1600:
    print("3")
elif a >= 1600 and a < 1800:
    print("2")
elif a >= 1800 and a < 2000:
    print("1")

Buggy submission (verdict: Runtime Error):
	a=int(input())

    if a >= 400 and a < 600:
        print("8")
    elif a >= 600 and a < 800:
        print("7")
    elif a >= 800 and a < 1000:
        print("6")
    elif a >= 1000 and a < 1200:
        print("5")
    elif a >= 1200 and a < 1400:
        print("4")
    elif a >= 1400 and a < 1600:
        print("3")
    elif a >= 1600 and a < 1800:
        print("2")
    elif a >= 1800 and a < 2000:
        print("8")
Problem p02657 (python)

Fixed submission:
x,y = map(int,input().split())	
print(x*y)

Buggy submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)

Buggy submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)