Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y,z = int().split(',')
print(x,y,z)

Fixed submission:
x, y, z = input().split(',')
print(x, y, z)

Buggy python submission (verdict: Runtime Error):
x, y, z = input().split
print(x, y, z)

Fixed submission:
x, y, z = input().split(',')
print(x, y, z)
Buggy python submission (verdict: Runtime Error):
N = input()
if N in "aiueo"
	print("vowel")
else
	print("consonant")
  

Fixed submission:
N = input()
if N in "aiueo":
	print("vowel")
else:
	print("consonant")

Buggy python submission (verdict: Runtime Error):
N = input()
if "a","e","i","o","u" in N
	print("vowel")
else
	print("consonant")
  

Fixed submission:
N = input()
if N in "aiueo":
	print("vowel")
else:
	print("consonant")

Buggy python submission (verdict: Runtime Error):
N = input()
if a,e,i,o,u in N
	print("vowel")
else
	print("consonant")
  

Fixed submission:
N = input()
if N in "aiueo":
	print("vowel")
else:
	print("consonant")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' ')
print(int(a*b))

Fixed submission:
a, b = map(str, input().split(' '))
a = int(a)
b = int(''.join(b.split('.')))
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' ')
print(a*(a-1)/2 + b*(b-1)/2)

Fixed submission:
a, b = map(int, input().split(' '))
print(int(a*(a-1)/2 + b*(b-1)/2))
Buggy python submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
boolean_matrix.sum(axis=0).max() >= 3 or \
np.diag(boolean_matrix).sum() >= 3 or \
np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or boolean_matrix.sum(axis=0).max() >= 3 or np.diag(boolean_matrix).sum() >= 3 or np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

import sympy

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

Ai = []
count = 0
for i in range(N):
    Ai = make_divisors(A[i])
    for j in range(len(Ai)):
        if Ai[j] in A and Ai[j] != A[i]:
            count += 1
            break

print(N - count)

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

for i in range(5):
    if x[i] == 0:
        print(i+1)

Buggy python submission (verdict: Runtime Error):
X, N = list(map(int, input().split()))
if N > 0:
    p = list(map(int, input().split()))
else:
    print(X)
    
y = list(range(1, 101))
for i in range(N):
    if p[i] in y:
        y.remove(p[i])
        
new_y = []
for i in range(len(y)):
    new_y.append(abs(y[i]-X))


print(y[new_y.index(min(new_y))])

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

for i in range(5):
    if x[i] == 0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
[print(a//t*b)for a,b,t in[[int(i)for i in input().split()]]

Fixed submission:
[print(int((t+0.5)//a)*b)for a,b,t in[[int(i)for i in input().split()]]]
Buggy python submission (verdict: Runtime Error):
[print(t*x)for t,x in[[int(i) for i in　input().split()]]] 

Fixed submission:
[print(t/x)for t,x in[[int(i) for i in input().split()]]]
Buggy python submission (verdict: Runtime Error):
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()\',")+'\n')

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

print("Yay!") if abs(a-b) <= 1 else print(":(")

Fixed submission:
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()\',")+'\n')

a,b = f()

print("Yay!") if abs(a-b) <= 1 else print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stderr
from functools import reduce
from operator import add
def f(): [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()',")+'\n')

n = int(input())
s = list(input())

longest = {"E":(0,1),"W":(0,1)}
# index,num of people who is E

i = 0
state = ""
po = 0
while i < n:
    debug(i)
    if po == 0:
        debug("po==0")
        po += 1
        state = s[i]
        i += 1
    else:
        if s[i] == state:
            debug(state,"po increased")
            po += 1
            i += 1
        else:
            debug("po changed")
            if longest[state][1] <= po:
                if state == "E":
                    longest[state] = (i-1, po)
                else:
                    longest[state] = (i-po-1,po)
            po = 0
            i += 1

debug(longest)
if longest["E"][1] < longest["W"][1]:
    leader = longest["W"][0]
else:
    leader = longest["E"][0]

ans = 0
debug(leader,s)
for i in range(leader):
    if s[i] == "W":
        debug(i)
        ans += 1
for i in range(leader+1,n):
    if s[i] == "E":
        debug(i)
        ans += 1

print(ans)

Fixed submission:
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()\',")+'\n')

n = int(input())
s = list(input())

must = [0 for i in range(n)]
# 一番左の人の値を決める
for i in range(1,n):
    if s[i] == "E":
        must[0] += 1
# 2番目以降の人
for j in range(1,n):
    must[j] = must[j-1]
    if s[j-1] == "W":
        must[j] += 1
    if s[j] == "E":
        must[j] -= 1
print(min(must))
Buggy python submission (verdict: Runtime Error):
x = int(input())
ans = 1
for i in range(2, 1000):
    j = 2
    while i**j <= x:
        ans = max(ans, i**j)
    j += 1
    if i > x:
        break
print(ans)

Fixed submission:
from sys import stderr
from functools import reduce
from operator import add
f = lambda: [int(i) for i in input().split()]
debug = lambda *x: stderr.write(reduce(add, repr(x)) + '\n')

a, b, c, d = f()
if (abs(a - b) <= d and abs(b - c) <= d) or abs(a - c) <= d:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
ans = 1
for i in range(2, 1000):
    j = 2
    while i**j <= x:
        ans = max(ans, i**j)
    j += 1
    if i > x:
        break
print(ans)


Fixed submission:
x = int(input())
ans = 1
for i in range(2, 1000):
    j = 2
    while i**j <= x:
        ans = max(ans, i**j)
        j += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
ans = []
cost = 0
now = 0
for po in A[1:]:
    cost += abs(po-now)
    now = po
cost += abs(now)
ans.append(cost)

for i in range(1,N-1):
    cost = 0
    now =  0
    for po in A[:i]+A[i+1:]:
        cost += abs(po-now)
        now = po
    cost += abs(now)
    ans.append(cost)

cost = 0
now =  0
for po in A[:N-1]:
    cost += abs(po-now)
    now = po
cost += abs(now)
ans.append(cost)


print(*ans,sep="\n")

Fixed submission:
from array import array   
N = int(input())
A = [int(i) for i in input().split()]
# 何も取りやめないときの総コスト
now = 0
cost = 0
for po in A:
    cost += abs(now - po)
    now = po
cost += abs(now)

dist = array('l',[0]+A+[0,0])
# i番目を取りやめる
for i in range(N):
    ans = cost
    ans += (abs(dist[i]-dist[i+2])) - (abs(dist[i]-dist[i+1])+abs(dist[i+1]-dist[i+2]))
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
f = lambda :[int(i) for i in input().split()]

ans = 0
N,M = f()

stat = [[0 for i in range(M)] for j in range(N)]

for h in range(N):
    for k in range(M):
        for ypos in range(-1,2):
            for xpos in range(-1,2):
                if 0 <= h+ypos < N and 0 <= k +xpos < M:
                    stat[h+ypos][k+xpos] += 1

for a in stat:
    for b in a:
        if b % 2 == 1:
            ans += 1
print(ans)

Fixed submission:
f = lambda :[int(i) for i in input().split()]

N,M = f()

print(abs(N*M-(N*2+M*2-4)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = {"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(N):
    s = input()
    if s[0] in ["M","A","R","C","H"]
        S[s[0]] += 1

print(S["M"] * S["A"] * (S["R"]+S["C"]+S["H"]) + S["M"] * S["R"] * (S["C"] + S["H"]) + S["M"] * S["C"] * S["H"] + S["A"] * S["R"] * (S["C"] + S["H"]) + S["C"] * S["A"] * S["H"] +  S["R"] * S["C"] * S["H"])


Fixed submission:
N = int(input())
S = {"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(N):
    s = input()
    if s[0] in ["M","A","R","C","H"]:
        S[s[0]] += 1

print(S["M"] * S["A"] * (S["R"] + S["C"] + S["H"])
      + S["M"] * S["R"] * (S["C"] + S["H"])
      + S["M"] * S["C"] * S["H"]
      + S["A"] * S["R"] * (S["C"] + S["H"])
      + S["A"] * S["C"] * S["H"]
      + S["R"] * S["C"] * S["H"])
Buggy python submission (verdict: Runtime Error):
from math import log10
N = int(input())
ans = []
for i in range(1,int(log10(N))+1):
    ans.append((sum(map(int,list(str((int(N/(10**i))*(10**i)-1)))))))
print(max(ans))

Fixed submission:
N = list(map(int,str(input())))
N_ = N[1:]
ans = N[0]+(9*len(N_))
if all([N_[i] == 9 for i in range(len(N_))]):
    print(ans)
else:
    print(ans-1)
Buggy python submission (verdict: Runtime Error):
[print(x*(y-1) if y%=x else -1) for x,y in [[int(i) for i in input().split()]]]

Fixed submission:
[print(x*(y-1)if x%y else-1)for x,y in[[int(i)for i in input().split()]]]

Buggy python submission (verdict: Runtime Error):
from math import gcd

X,Y = [int(i) for i in input().split()]

def lcm(a,b):
    return a*b/gcd(a,b)

i = 2
while True:
    if (X * i) % Y != 0:
        print(X*i)
        break
    elif (X * i) >= lcm(X,Y):
        print(-1)
        break
    else:
        i += 1

Fixed submission:
[print(x*(y-1)if x%y else-1)for x,y in[[int(i)for i in input().split()]]]
Buggy python submission (verdict: Runtime Error):
s = str
End = False
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
    for j in [C,-1*C]:
        for k in [D,-1*D]:
            if A + i + j + k == 7:
                print(f"{A:d}{i:+d}{j:+d}{k:+d}=7")
                exit()

Fixed submission:
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
    for j in [C,-1*C]:
        for k in [D,-1*D]:
            if A + i + j + k == 7:
                print("{:d}{:+d}{:+d}{:+d}=7".format(A,i,j,k),end="")
                exit()

Buggy python submission (verdict: Runtime Error):
s = str
End = False
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
    for j in [C,-1*C]:
        for k in [D,-1*D]:
            if A + i + j + k == 7:
                print(f"{A:d}{i:+d}{j:+d}{k:+d}=7")
                End = True
                break
        if End:
            break
    if End:
        break


Fixed submission:
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
    for j in [C,-1*C]:
        for k in [D,-1*D]:
            if A + i + j + k == 7:
                print("{:d}{:+d}{:+d}{:+d}=7".format(A,i,j,k),end="")
                exit()
Buggy python submission (verdict: Runtime Error):
r = int(input());g = int(input());print(2*G-r)

Fixed submission:
r = int(input());g = int(input());print(2*g-r)
Buggy python submission (verdict: Runtime Error):
letters = [chr(i) for i in range(97,123)]
string  = input()
for j in range(len(string)) if string[j] in letters:
    letters.remove(string[j])
print(letters[0])

Fixed submission:
letters = [chr(i) for i in range(97,123)]
string  = input()
for j in range(len(string)):
    if string[j] in letters:
        letters.remove(string[j])
    else:
        continue
if letters:
    print(letters[0])
else:
    print("None")
Buggy python submission (verdict: Runtime Error):
print(["NO","YES"][int("".join(input().split()))])

Fixed submission:
from sys import stderr, setrecursionlimit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1):
    if n == 1:
        return [int(i) for i in input().split()]
    res = []
    for i in range(n):
        res.append([int(j) for j in input().split()])
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

rgb = int("".join(input().split()))
print("NO" if rgb%4 else "YES")

Buggy python submission (verdict: Runtime Error):
print(["NO","YES"][int(input())%4==0])

Fixed submission:
from sys import stderr, setrecursionlimit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1):
    if n == 1:
        return [int(i) for i in input().split()]
    res = []
    for i in range(n):
        res.append([int(j) for j in input().split()])
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

rgb = int("".join(input().split()))
print("NO" if rgb%4 else "YES")
Buggy python submission (verdict: Runtime Error):
from sys import stderr, setrecursionlimit, exit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1, flag=False):
    res = []
    for _ in range(n):
        line = [int(i) for i in input().split()]
        if flag or len(line) == 1:
            res.append(line[0])
            flag = True
        else:
            res.append(line)
    if n == 1:
        return res[0]
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

def solve(s, a, n):
    if s % 10 != 0:
        return s
    

n = f()
s = f(n)
s.sort(reverse=True)
su = sum(s)
# 10で割り切れるなら一番小さいやつを引く
# それでもだめなら2つ目，それもだめなら3つ目
# ↑1つ目≡0(mod 10),2つ目≡0(mod 10)なら当然1つ目+2つ目≡0(mod 10)なので3つ目のみ検討すればOK
if su % 10 != 0:
    print(su)
    exit()
i = -1
while True:
    su -= s[i]
    if su % 10 != 0:
        print(su)
        exit()
    su += s[i]
    i -= 1
    if i < -n:
        print(0)
        exit()


Fixed submission:
from sys import stderr, setrecursionlimit, exit
from functools import reduce
from operator import add
setrecursionlimit(2147483647)
def f(n=1, flag=False):
    res = []
    for _ in range(n):
        line = [int(i) for i in input().split()]
        if flag or len(line) == 1:
            res.append(line[0])
            flag = True
        else:
            res.append(line)
    if n == 1:
        return res[0]
    return res
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

n = f()
s = []
for i in range(n):
    s.append(int(input()))
s.sort(reverse=True)
su = sum(s)
# 10で割り切れるなら一番小さいやつを引く
# それでもだめなら2つ目，それもだめなら3つ目
# ↑1つ目≡0(mod 10),2つ目≡0(mod 10)なら当然1つ目+2つ目≡0(mod 10)なので3つ目のみ検討すればOK
if su % 10 != 0:
    print(su)
    exit()
i = -1
while True:
    su -= s[i]
    if su % 10 != 0:
        print(su)
        exit()
    su += s[i]
    i -= 1
    if i < -n:
        print(0)
        exit()
Buggy python submission (verdict: Runtime Error):
a,b = [int(i) for i in input().split()]
if a < b:
    print("LESS")
elif a > b:
    print("GREATER")
else:
    print("EQUAL")

Fixed submission:
a = int(input())
b = int(input())
if a < b:
    print("LESS")
elif a > b:
    print("GREATER")
else:
    print("EQUAL")
Buggy python submission (verdict: Runtime Error):
[print(len(list(i.groupby(input())))-1)for i in[__import__('itertools')]][print(len(list(i.groupby(input())))-1)for i in[__import__('itertools')]]

Fixed submission:
from sys import stdin, stderr, setrecursionlimit, exit
setrecursionlimit(2147483647)
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

ans = 0
s = input()

for i in range(1, len(s)):
    if s[i-1] != s[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add, repr(x)).strip("()\',") + '\n')

n, a = f()
x = f()
s = sum(x)

dp = [[[0 for i in range(n + 1)] for j in range(s + 1)] for k in range(n + 1)]
for i in range(n + 1):
    dp[i][0][0] = 1

for i in range(1, n + 1):
    for j in range(1, s + 1):
        for k in range(1, n + 1):
            dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - x[i - 1]][k - 1]

ans = 0
k = 1
while a * k <= s and k <= n:
    ans += dp[n][a*k][k]
    k += 1
print(ans)


Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
    print(x*k + y*(n-k))
else:
    print(x*n)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add, repr(x)).strip("()\',") + '\n')

n, a = f()
x = f()
s = sum(x)

dp = [[[0 for i in range(n + 1)] for j in range(s + 1)] for k in range(n + 1)]
for i in range(n + 1):
    dp[i][0][0] = 1

for i in range(1, n + 1):
    for j in range(1, s + 1):
        for k in range(1, n + 1):
            dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - x[i - 1]][k - 1]

ans = 0
k = 1
while a * k <= s and k <= n:
    ans += dp[n][a*k][k]
    k += 1
print(ans)


Fixed submission:
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add, repr(x)).strip("()\',") + '\n')

n, a = f()
x = f()
s = sum(x)

dp = [[[0 for i in range(n + 1)] for j in range(s + 1)] for k in range(n + 1)]
for i in range(n + 1):
    dp[i][0][0] = 1

for i in range(1, n + 1):
    for j in range(1, s + 1):
        for k in range(1, n + 1):
            dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - x[i - 1]][k - 1]

ans = 0
k = 1
while a * k <= s and k <= n:
    ans += dp[n][a*k][k]
    k += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

if 0 in A:
    print(0)
    return

ans = 1
for a in A:
    ans *= a
    if ans > 1000000000000000000:
        print(-1)
        return

print(ans)

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

    if 0 in A:
        print(0)
        return

    ans = 1
    for a in A:
        ans *= a
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
A = map(int, input().split())

print(*np.argsort(A)+1)

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
tmp = np.argsort(A)+1
print(*tmp)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count() == 1 for c in S[i:j+1]):
            ans = max(ans, j-i+1)
print(ans)

Fixed submission:
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i:j+1]):
            ans = max(ans, j-i+1)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(N)]
 
 
dp = [[float('-inf') for _ in range(1000000)] for _ in range(N+10)]
dp[0][0] = 0
for i, (item_weight, item_value) in enumerate(items):  # i番目の品
    for total_weight in range(W+10):                   # 重さの合計
        dp[i+1][total_weight] = max(dp[i][total_weight], dp[i+1][total_weight])
        dp[i+1][total_weight+item_weight] = max(dp[i][total_weight]+item_value, dp[i+1][total_weight+item_weight])
        
print(dp[N][W])

Fixed submission:
import math

N = int(input())
vals = list(map(int, input().split()))


def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [float('inf')] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
vals = list(map(int, input().split()))


def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [math.inf] * 100010
dp[0] = 0
for i in range(N):
    # chmin(dp[i], dp[i-1] + abs(vals[i]-vals[i-1]))
    chmin_orig(i, i-1)
    if i > 1:
        # chmin(dp[i], dp[i-2] + abs(vals[i]-vals[i-2]))
        chmin_orig(i, i-2)

print(dp[N-1])


Fixed submission:
import math

N = int(input())
vals = list(map(int, input().split()))


def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [float('inf')] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])

Buggy python submission (verdict: Runtime Error):
def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [math.inf] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])

Fixed submission:
import math

N = int(input())
vals = list(map(int, input().split()))


def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [float('inf')] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])