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

Fixed submission:
import sys
st = input()
if len(st) < 4:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
st = input()
if len(st) < 3:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
st = input()
if len(st) < 3:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
Problem p03943 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
if a+b=c:
    print(“Yes”)
if else b+c=a:
    print(“Yes”)
if else a+c=b:
    print(“Yes”)
else:
    print(“No”)
Problem p03324 (python)

Fixed submission:
D, N=map(int,input().split(' '))

if N>=100:
  N+=1

print(N*100**D)

Buggy submission (verdict: Runtime Error):
D, N=map(int,input().split(' '))

assert N<100

print(N*100**D)
Problem p03330 (python)

Fixed submission:
N,C=map(int,input().split(' '))
D=[]
for _ in range(C):
  D.append([ x for x in map(int,input().split(' '))])

c=[]
for _ in range(N):
  c.append([ x for x in map(int,input().split(' '))])

x=float('inf')

memo={}

counter=[[0]*C for _ in range(3)]
for i in range(N):
  for j in range(N):
    b=i%3
    cur=c[i][j]
    counter[(j+b)%3][cur-1]+=1
    #s+=D[cur-1][seq[(j+b)%3]]

for c0 in range(C):
  for c1 in range(C):
    if c1==c0:
      continue
    for c2 in range(C):
      if c2==c0 or c2==c1:
        continue
      s=0
      for i, cx in enumerate(counter[0]):
        s+=D[i][c0]*cx
      for i, cx in enumerate(counter[1]):
        s+=D[i][c1]*cx
      for i, cx in enumerate(counter[2]):
        s+=D[i][c2]*cx
      if s<x:
        x=s


print(x)

Buggy submission (verdict: Runtime Error):
N,C=map(int,input().split(' '))
D=[]
for _ in range(C):
  D.append([ x for x in map(int,input().split(' '))])

c=[]
for _ in range(N):
  c.append([ x for x in map(int,input().split(' '))])

x=float('inf')

memo={}

for seq in [[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]:
  counter=[[0]*C for _ in range(3)]
  for i in range(N):
    for j in range(N):
      b=i%3
      cur=c[i][j]
      counter[seq[(j+b)%3]][cur-1]+=1
      #s+=D[cur-1][seq[(j+b)%3]]
  if str(counter) in memo:
    s=memo(str(counter))
    if s<x:
      x=s
  else:
    memox=x
    for c0 in range(C):
      for c1 in range(C):
        if c1==c0:
          continue
        for c2 in range(C):
          if c2==c0 or c2==c1:
            continue
          else:
            s=0
            for i, cx in enumerate(counter[0]):
              s+=D[i][c0]*cx
            for i, cx in enumerate(counter[1]):
              s+=D[i][c1]*cx
            for i, cx in enumerate(counter[2]):
              s+=D[i][c2]*cx
          if s<memox:
            memox=s
    memo[str(counter)]=memox
    if memox<x:
      x=memox


print(x)
Problem p03337 (python)

Fixed submission:
A,B=map(int,input().split(' '))

print(max(A+B, A-B, A*B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,raw_input().split(' '))

print(max(A+B, A-B, A*B))
Problem p03496 (python)

Fixed submission:
N=int(raw_input())
a=map(int,raw_input().split(' '))

flg=0
if abs(max(a))>=abs(min(a)):
  m=max(a)
  flg=1
else:
  m=min(a)

for i in range(len(a)):
  if a[i]==m:
    p=i
    break

print 2*N-1
for i in range(N):
  print p+1, i+1
  a[i]+=a[p]

if flg:
  for i in range(N-1):
    print i+1, i+2
    a[i+1]+=a[i]
else:
  for i in range(N-1)[::-1]:
    print i+2, i+1
    a[i]+=a[i+1]
#print a

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(raw_input())
a=map(int,raw_input().split(' '))

ans=[]


def check(l):
  for i in range(len(l)-1):
    if l[i]>l[i+1]:
      return 0
  return 1

u=N-1
while not check(a):
  p=np.argmax(a[0:u+1])
  m=max(a[0:u+1])
  if p==u:
    u-=1
  else:
    if m>0:
      for i in range(p+1,u+1):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]
    else:
      p=np.argmin(a)
      m=min(a)
      for i in range(p):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]

print len(ans)
for an in ans:
  x,y=an
  print x,y

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(raw_input())
a=map(int,raw_input().split(' '))

ans=[]

if len(set(a))==1:
  p=0
else:
  p=N-1

def check(l):
  for i in range(len(l)-1):
    if l[i]>l[i+1]:
      return 0
  return 1

l=0
u=N-1
while not check(a):
  p=np.argmax(a[0:u+1])
  m=max(a[0:u+1])
  if p==u:
    u-=1
  else:
    if m>0:
      for i in range(p+1,u+1):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]
    else:
      p=np.argmin(a[0:u+1])
      m=min(a[0:u+1])
      for i in range(p):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]

print len(ans)
for an in ans:
  x,y=an
  print x,y
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,raw_input().split(' '))

if a==b:
    print c
elif b==c:
    print a
else:
    print b

Buggy submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans
Problem p03575 (python)

Fixed submission:
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*M
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans

Buggy submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans

Buggy submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=1
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans
Problem p03607 (python)

Fixed submission:
N=int(raw_input())

num={}
for i in range(N):
    a=int(raw_input())
    if a in num:
        num[a]^=1
    else:
        num[a]=1

c=0
for k in num:
    if num[k]==1:
        c+=1
print c

Buggy submission (verdict: Runtime Error):
N=int(raw_input())

n=[0]*(10**9+1)

for i in range(N):
    a=int(raw_input())
    n[a]^=1

print n.count(1)
Problem p03693 (python)

Fixed submission:
r,g,b=map(int,raw_input().split(' '))
                 
if (r*100+g*10+b)%4==0:
    print "YES"
else:
    print "NO"

Buggy submission (verdict: Runtime Error):
    r,g,b=map(int,raw_input().split(' '))
     
    if (r*100+g*10+b)%4==0:
      print "YES"
    else:
      print "NO"
Problem p03696 (python)

Fixed submission:
N=int(raw_input())
S=raw_input()

s=list(S)

i=0
j=0
while i<N and j<N:
    #print i,s
    if s[i]=='(':
        j=i
        while j<N:
            #print i,j
            if s[j]==')':
                s[i]='x'
                s[j]='x'
                #print (i,j),s
                i+=1
                break
            else:
                j+=1
    else:
        i+=1

op=s.count(')')
cl=s.count('(')

print '('*op+S+')'*cl

Buggy submission (verdict: Runtime Error):
N=int(raw_input())
S=raw_input()

op=0
cl=0

i=0
j=len(S)-1
while i<=j:
    if i==j:
        if S[i]=='(':
            cl+=1
        else:
            op+=1
        break
    while S[i]!='(':
        i+=1
        op+=1
    while S[j]!=')':
        j-=1
        cl+=1
    if i<j:
        i+=1
        j-=1

r='('*op+S+')'*cl

print r

Buggy submission (verdict: Runtime Error):
N=int(raw_input())
S=raw_input()

op=S.count('(')
cl=S.count(')')

if op>cl:
    r=S+')'*(op-cl)
elif cl>op:
    r='('*(cl-op)+S

print r
Problem p03737 (python)

Fixed submission:
s1,s2,s3 = raw_input().split(' ')

print (s1[0]+s2[0]+s3[0]).upper()

Buggy submission (verdict: Runtime Error):
a=int(raw_input())
b=int(raw_input())

if a>b:
    print "GREATER"
elif a<b:
    print "LESS"
else:
    print "EQUAL"
Problem p03738 (python)

Fixed submission:
a=int(raw_input())
b=int(raw_input())

if a>b:
    print "GREATER"
elif a<b:
    print "LESS"
else:
    print "EQUAL"

Buggy submission (verdict: Runtime Error):
a=int(raw_input)
b=int(raw_input)

if a>b:
    print "GREATER"
elif a<b:
    print "LESS"
else:
    print "EQUAL"
Problem p03773 (python)

Fixed submission:
a,b=raw_input().split(' ')
a=int(a)
b=int(b)

print (a+b)%24

Buggy submission (verdict: Runtime Error):
import math

N=int(raw_input())

n=math.floor(math.sqrt(N))

while(N%n!=0): n-=1

m=N/n
n=int(n)
m=int(m)

if n>=m:
    print len(str(n))
else:
    print len(str(m))
Problem p04029 (python)

Fixed submission:
n=int(input())
print(n*(n+1)//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[int(x) for x in input().split()]
s.sort()
a=s[0]
b=s[-1]
m=9999999999999
for i in range(a,b+1):
    sum=0    
    for j in s:
        sum+=(j-i)**2
    if sum < m:
        m=sum
        
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[int(x) for x in input().split()]
s.sort()
a=s[0]
b=s[-1]
m=9999999999999
for i in range(a,b+1):
    sum=0    
    for j in s:
        sum+=(j-i)**2
    if sum < m:
        m=sum
        
print(m)
Problem p03722 (python)

Fixed submission:
N, M = map(int, input().split())
edge = []
for i in range(M):
    a,b,c = map(int, input().split())
    edge.append((a-1,b-1, c))
point = [None] * N
point[0] = 0
for i in range((N*4)//3):
    for a,b,c in edge:
        if point[a] is not None:
            if point[b] is None:
                point[b] = point[a] + c
            point[b] = max(point[b], point[a] + c)
current_point = point[N-1]
for i in range(5):
    for a,b,c in edge:
        if point[a] is not None:
            if point[b] is None:
                point[b] = point[a] + c
            point[b] = max(point[b], point[a] + c)
if current_point < point[N-1]:
    print("inf")
else:
    print(current_point)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
edge = []
for i in range(M):
    a,b,c = map(int, input().split())
    edge.append((a-1,b-1, c))
point = [None] * N
point[0] = 0
for i in range(N):
    for a,b,c in edge:
        if point[a] is not None:
            if point[b] is None:
                point[b] = point[a] + c
            point[b] = max(point[b], point[a] + c)
current_point = point[N-1]
for a,b,c in edge:
    if point[a] is not None:
        if point[b] is None:
            point[b] = point[a] + c
    point[b] = max(point[b], point[a] + c)
if current_point < point[N-1]:
    print("inf")
else:
    print(current_point)
Problem p03331 (python)

Fixed submission:
def digit_sum(i):
    return sum([int(digit) for digit in list(str(i))])

N = int(input())
ret = 10000
for A in range(1, N):
    ret = min(ret, digit_sum(A) + digit_sum(N-A))
print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input())
ret = 10000
for A in range(1, N):
    ret = min(ret, digit_sum(A) + digit_sum(N-A))
print(ret)
Problem p03393 (python)

Fixed submission:
import string
 
S = input()
if len(S) < 26:
    for c in string.ascii_lowercase:
        if c not in S:
            break
    print(S + c)
else:
    ret = None
    for i in range(26):
        if max(S[25-i:]) != S[25-i]:
            mc = 'z'
            for c in S[25-i:]:
                if c > S[25-i]:
                    mc = min(c, mc)
            ret = S[:25-i] + mc
            break
            
    if ret is None:
        print(-1)
    else:
        print(ret)

Buggy submission (verdict: Runtime Error):
import string

S = input()
if len(S) < 26:
    for c in string.ascii_lowercase:
        if c not in S:
            break
    print(S + c)
else:
    ret = None
    for i in range(26):
        if max(S[25-i:]) != S[25-i]:
            mc = 'z'
            for c in S[25-i:]:
                if c > S[25-i]:
                    mc = min(c, mc)
            ret = S[:25-i] + mc
            break
            
    if ret is None:
        print(-1)
    else:
        print(ret)
S = input()
if len(S) < 26:
    for c in string.ascii_lowercase:
        if c not in S:
            break
    print(S + c)
else:
    ret = None
    for i in range(26):
        if max(S[25-i:]) != S[25-i]:
            mc = 'z'
            for c in S[25-i:]:
                if c > S[25-i]:
                    mc = min(c, mc)
            ret = S[:25-i] + mc
            break
            
    if ret is None:
        print(-1)
    else:
        print(ret)

Buggy submission (verdict: Runtime Error):
S = input()
if len(S) < 26:
    for c in string.ascii_lowercase:
        if c not in S:
            break
    print(S + c)
else:
    ret = None
    for i in range(26):
        if max(S[25-i:]) != S[25-i]:
            mc = 'z'
            for c in S[25-i:]:
                if c > S[25-i]:
                    mc = min(c, mc)
            ret = S[:25-i] + mc
            break
            
    if ret is None:
        print(-1)
    else:
        print(ret)
Problem p03404 (python)

Fixed submission:
def prity(mat, line):
    print(line, 100)
    for i in range(line):
        for j in range(100):
            print(mat[i][j], end='')
        print()

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

if A*B == 1:
    print(1, 2)
    print(".#")
else:

    mat = [['' for i in range(100)] for j in range(100)]

    # start with white
    line=0
    if A > 1: 
        B -= 1
        while A > 1:
            for j in range(50):
                if A > 1:
                    mat[line][2*j] = "."
                    A -= 1
                else:
                    mat[line][2*j] = "#"
                mat[line][2*j+1] = "#"
            for j in range(100):
                mat[line+1][j] = "#"
            line += 2

    # one line of white
    for j in range(100):
        mat[line][j] = "."
    A -= 1
    line += 1
    assert A == 0
    
    # finish black
    if B > 0:
        while B > 0:
            for j in range(50):
                if B > 0:
                    mat[line][2*j] = "#"
                    B -= 1
                else:
                    mat[line][2*j] = "."
                mat[line][2*j+1] = "."
            for j in range(100):
                mat[line+1][j] = "."
            line += 2

    prity(mat, line)

Buggy submission (verdict: Runtime Error):
def prity(mat, line):
    for i in range(line):
        for j in range(100):
            print(mat[i][j], end='')
        print()

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

if A*B == 1:
    print(".#")
    exit(1)

mat = [['' for i in range(100)] for j in range(100)]

line=0
if B > 1 and A > 1: # start with white
    B -= 1
    while A > 1:
        for j in range(50):
            if A > 1:
                mat[line][2*j] = "."
                A -= 1
            else:
                mat[line][2*j] = "#"
            mat[line][2*j+1] = "#"
        for j in range(100):
            mat[line+1][j] = "#"
        line += 2
        
for j in range(100):
    mat[line][j] = "."
A -= 1
line += 1
assert A == 0

if B > 1:
    while B > 0:
        for j in range(50):
            if B > 0:
                mat[line][2*j] = "#"
                B -= 1
            else:
                mat[line][2*j] = "."
            mat[line][2*j+1] = "."
        for j in range(100):
            mat[line+1][j] = "."
        line += 2
        
prity(mat, line)
Problem p03452 (python)

Fixed submission:
import numpy as np

def solve(N, edge):
    x_arr = np.zeros(N).astype(int)
    visited = np.zeros(N).astype(bool)
    
    isValid = True
    for n in range(N):
        if not(visited[n]):
#            print("start with {}".format(n))
            stack = []
            stack.append((n, 0))
            while len(stack) > 0:
#                print(stack)
                i, x = stack[-1]
                stack.pop()
                
                if visited[i] and x_arr[i] != x: # if already visited
#                    print("err", i, x, x_arr[i])
                    isValid = False
                elif not(visited[i]): # if first time to visit
                    visited[i] = True
                    x_arr[i] = x
                    for j, c in edge[i]:
                        stack.append((j, x + c))
    return isValid
  
N, M = [int(_) for _ in input().split()]
edge = [[] for _ in range(N)]

for _ in range(M):
    left, right, dist = [int(_) for _ in input().split()]
    left -= 1
    right -= 1
    edge[left].append((right, dist))
    edge[right].append((left, -dist))
    
if solve(N, edge):
    print("Yes")
else:
    print("No")

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

class Solver:
    def __init__(self, N, edge):
        self.N = N
        self.edge = edge
        
    def dfs(self, i, x):
        self.x_arr[i] = x
        self.visited[i] = True

        isValid = True
        for (to, cost) in self.edge[i]:
            if self.visited[to] and self.x_arr[to] != x + cost:
                isValid = False
            elif not(self.visited[to]):
                isValid = self.dfs(to, x + cost)
            if not(isValid):
                break
        return isValid
        
    def solve(self):
        self.x_arr = np.zeros(self.N).astype(int)
        self.visited = np.zeros(self.N).astype(bool)
        
        isValid = True
        for i in range(self.N):
            if not(self.visited[i]):
                isValid = self.dfs(i, 0)
                if not(isValid):
                    break
        return isValid
    
def main():
    N, M = [int(_) for _ in input().split()]
    edge = [[] for _ in range(N)]

    for _ in range(M):
        left, right, dist = [int(_) for _ in input().split()]
        left -= 1
        right -= 1
        edge[left].append((right, dist))
        edge[right].append((left, -dist))
        
    solver = Solver(N, edge)
    if (solver.solve()):
        print("Yes")
    else:
        print("No")
        
if __name__=="__main__":
    main()
Problem p03498 (python)

Fixed submission:
import numpy as np

N=int(input())
a_lst=[int(_) for _ in input().split()]
a_arr=np.array(a_lst)
idx=np.absolute(a_arr).argmax() + 1 #1origin

if a_lst[idx-1]==0:
    print(0)
else:
    print(2*N-2)
    for i in range(1, N+1):
        if i != idx:
            print(idx, i)
    if a_lst[idx-1]>0:
        for i in range(1, N):
            print(i, i+1)
    elif a_lst[idx-1]<0:
        for i in range(N, 1, -1):
            print(i, i-1)

Buggy submission (verdict: Runtime Error):
N=int(input())
a_lst=[int(_) for _ in input().split()]
a_arr=np.array(a_lst)
idx=np.absolute(a_arr).argmax() + 1 #1origin

print(2*N-2)
for i in range(1, N+1):
    if i != idx:
        print(idx, i)
if a_lst[idx-1]>0:
    for i in range(1, N):
        print(i, i+1)
elif a_lst[idx-1]<0:
    for i in range(N, 1):
        print(i, i-1)
else:
    pass
Problem p03675 (python)

Fixed submission:
import math
import numpy as np

n=int(input())
a=np.array([int(i)  for i in input().split()])

b=np.zeros(n, dtype=int)
pos=math.ceil((n-1)/2)

forward=True
for i in range(n):
    #print("i:{0}, pos:{1}, a[i]:{2}".format(i, pos, a[i]))
    b[pos]=a[i]
    if forward:
        forward=False
        pos-=(i+1)
    else:
        forward=True
        pos+=(i+1)
        
if forward:
    for i in range(n):
        print(b[i],end=' ')
else:
    for i in range(n):
        print(b[n-1-i],end=' ')

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

def comb(n, k):
    if k<0 or n<k:
        return 0

    if n-k<k:
        k=n-k
    return round(math.factorial(n)/math.factorial(k)/math.factorial(n-k))

n=int(input())
a=np.array([int(i) for i in input().split()])

count_lst=[[] for _ in range(n)]
for i in range(n+1):
    count_lst[a[i]-1].append(i)

for i in range(n):
    if len(count_lst[i])==2:
        left=count_lst[i][0]
        right=count_lst[i][1]
gapLen=right-left-1

del count_lst


base=10**9+7

for k in range(1, n+2):
    #print("k={}".format(k))
    retVal=0
    #retVal+=comb(n-1, k-2)#両方in
    #print(retVal)
    #retVal+=comb(n-1, k)#両方out
    #print(retVal)
    
    #retVal+=comb(n-1-gapLen, k-1)#片方in, gapから1つも選ばれない
    #print(retVal)    
    retVal+=2*(comb(n-1, k-1)-comb(n-1-gapLen, k-1))
    print(retVal%base)
Problem p03687 (python)

Fixed submission:
s=input()
#s="whbrjpjyhsrywlqjxdbrbaomnw"
minCost=len(s)
char_set=set(s)
for char in char_set:
    m=max([len(_) for _ in s.split(char)])
    if m<minCost:
        minCost=m
print(minCost)

Buggy submission (verdict: Runtime Error):
s=input()
#s="whbrjpjyhsrywlqjxdbrbaomnw"
minCost=len(s)
for char in char_set:
    m=max([len(_) for _ in s.split(char)])
    if m<minCost:
        minCost=m
print(minCost)
Problem p03701 (python)

Fixed submission:
import numpy as np

N=int(input())
s_arr=np.zeros(N, dtype=np.int8)
for i in range(N):
    s_arr[i]=int(input())

total=np.sum(s_arr)
if total%10!=0:
    print(total)
else:
    msk=(s_arr%10!=0)
    if np.sum(msk)==0:
        print(0)
    else:
        print(total-np.min(s_arr[msk]))

Buggy submission (verdict: Runtime Error):
N=int(input())
s_arr=np.zeros(N, dtype=np.int8)
for i in range(N):
    s_arr[i]=int(input())

total=np.sum(s_arr)
if total%10!=0:
    print(total)
else:
    msk=(s_arr%10!=0)
    if np.sum(msk)==0:
        print(0)
    else:
        print(total-np.min(s_arr[msk]))
Problem p03351 (python)

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

ab = abs(a-b)
bc = abs(b-c)
if (abs(a-c)<= d)or(ab <= d and bc <= d):
    print("Yes")
else:
    print("No")

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

ab = abs(a - b)
bc = abs(b - c)
if (abs(a-c) =< d)or(ab =< d and bc =< d):
    print("Yes")
else:
    print("No")
Problem p03778 (python)

Fixed submission:
w,a,b=map(int,input().split())
print(0 if a<=b+w and b<=a+w else min(abs(a+w-b),abs(a-w-b)))

Buggy submission (verdict: Runtime Error):
w,a,b=map(int,input().split())
x,y=a+w,a-w
print(0 if x<b<y else min(abs(x-b,y-b)))
Problem p03826 (python)

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

Buggy submission (verdict: Runtime Error):
n,s=int(input()),input()
print(max([s[0:i].count('I')-s[0:i].count('D') for i in range(n)]))
Problem p03323 (python)

Fixed submission:
a,b = map(int,input().split())
if(a>8 or b>8):
    print (":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if(a>8 or b>8):
    print (":(")
else:
    print("Yay!")