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

Fixed submission:
class Graph:
    def __init__(self):
        self.g = {}
        self.node = set()

    def addEdge_single(self, x, y, w):
        self.g[(x, y)] = w
        self.node.add(x)
        self.node.add(y)

    def addEdge(self, x, y, w):
        self.addEdge_single(x, y, w)
        self.addEdge_single(y, x, w)

    def dijkstra(self, start):
        open = {start: 0}
        closed = {}
        prev = {start: -1}
        while len(open) > 0:
            x = Graph.select_min(open)
            m = open[x]
            del open[x]
            closed[x] = m
            for (y, w) in self.edge(x):
                if y in open:
                    if open[y] > m + w:
                        open[y] = m + w
                        prev[y] = x
                elif y not in closed:
                    open[y] = m + w
                    prev[y] = x
            # print("open:  {}".format(open))
            # print("closed:{}".format(closed))
            # print("prev:  {}".format(prev))
            # print("-----")
        return closed, prev

    @staticmethod
    def select_min(S):
        m = -1
        for a in S:
            if m == -1 or m > S[a]:
                x = a
                m = S[a]
        return x

    def edge(self, x):
        G = self.g
        return [(b, G[(a, b)]) for (a, b) in G if a == x]


N, M = [int(x) for x in input().split()]

AB = []
for _ in range(M):
    a, b = [int(x) for x in input().split()]
    AB.append((a, b))

ans = 0
for i in range(M):
    g = Graph()
    for j in range(M):
        if i != j:
            g.addEdge(AB[j][0], AB[j][1], 1)
    w, p = g.dijkstra(1)
    if len(w) != N:
        ans += 1
    # print("w:{}, len:{}".format(w, len(w)))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sys
import bisect

N, M = [int(x) for x in input().split()]
A = [None] * M
B = [None] * M
AB = [[0] * N for _ in range(N)]

for i in range(M):
    a,b = [int(x) for x in input().split()]
    A[i] = a - 1
    B[i] = b - 1
    AB[a - 1][b - 1] = 1
    AB[b - 1][a - 1] = 1

def isRenketsu(MAT):
    openNode = {0}
    reachableNode = {0}

    while(len(openNode) != 0):
        n = openNode.pop()
        for i in range(M):
            if MAT[n][i] == 1:
                if i in reachableNode:
                    pass
                else:
                    openNode.add(i)
                    reachableNode.add(i)
    return len(reachableNode) == N


ret = 0
for i in range(M):
    AB[A[i]][B[i]] = 0
    AB[B[i]][A[i]] = 0
    if isRenketsu(AB) == False:
        ret += 1
    AB[A[i]][B[i]] = 1
    AB[B[i]][A[i]] = 1

print(ret)
Problem p03633 (python)

Fixed submission:
import math


def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x


def lcm(x, y):
    return (x * y) // gcd(x, y)


N = int(input())
T = []

for _ in range(N):
    T.append(int(input()))

ans = T[0]

for t in T:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N = int(input())
T = []

for _ in range(N):
    T.append(int(input()))


ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N = int(input())
T = []

for _ in range(N):
    T.append(int(input()))


ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N = int(input())
T = []

for _ in range(N):
    T.append(int(input()))


ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)

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

N = int(input())
T = []

for _ in range(N):
    T.append(int(input()))

def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

from math import gcd
from functools import reduce


def lcm(x, y):
    return (x * y) // gcd(x, y)


ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

from math import gcd
from functools import reduce


def lcm(x, y):
    return (x * y) // gcd(x, y)

ans = reduce(lcm, T)
print(ans)
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
c=A-2*B
print(max(0,c))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=b*2
if a-c>0:
  print(a-c)
else:
  print("0")
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(max(a+b, a-b, a*b))
Problem p03219 (python)

Fixed submission:
x,y=(int(i) for  i in input().split(' '))
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x,y=(int(i) for  i in input().split(' ')
print(x+y//2)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=(int(i) for i in input().split(' '))
h=[int(i) for i in input().split(' ')]
T=[]
for i in range(n):
  T=T+[t-0.006*h[i]]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=(int(i) for i in input().split(' '))
h=[int(i) for i in input().split(' ')]
T=[]
for i in range(n):
  T[i]=t-h[i]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)
Problem p03243 (python)

Fixed submission:
N = int(input())
for i in range(1, 10):
    if((i-1)*111<N and N<=i*111):
        print(i*111)

Buggy submission (verdict: Runtime Error):
N =0 int(input())
for i in range(1, 10):
    if((i-1)*111<x and x<=i*111):
        print(i*111)

Buggy submission (verdict: Runtime Error):
N =0 int(input())
for i in range(1, 10):
    if((i-1)*111<x and x<=i*111)
    print(i*111)
Problem p03260 (python)

Fixed submission:
s = [int(i) for i in input().split()]
if(s[0] * s[1] % 2 == 1):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr

    # データの状態に左右されないためにrandom.choice()を用いることもある。
    # ref = random.choice(arr)
    ref = arr[0]
    ref_count = 0

    for ele in arr:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = quick_sort(left)
    right = quick_sort(right)
    return left + [ref] * ref_count + right

def LCM(m,n):
  for i in range(1,m+1)[::-1]:
    if n%i==0:
      return i
    
N,X=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
x=[X]+x
x=quick_sort(x)
D=abs(x[1]-x[0])
for i in range(N):
  D=LCM(D,abs(x[i+1]-x[i]))
print(D)

Buggy submission (verdict: Runtime Error):
def LCM(m,n):
  for i in range(1,m+1)[::-1]:
    if n%i==0:
      return i
    
N,X=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
x=[X]+x
x.sort()
D=x[1]-x[0]
for i in range(N):
  D=LCM(D,x[i+1]-x[i])
print(D)

Buggy submission (verdict: Runtime Error):
N=int(input())
W=[]
for i in range(N):
  W.append(input())
for i in range(N-1):
  if W[i][-1] != W[i+1][0]:
    print('No')
    exit()
  for j in range(i+1, N):
    if W[i]==W[j]:
      print('No')
      exit()
print('Yes')
Problem p03261 (python)

Fixed submission:
N=int(input())
W=[]
for i in range(N):
  W.append(input())
for i in range(N-1):
  if W[i][-1] != W[i+1][0]:
    print('No')
    exit()
  for j in range(i+1, N):
    if W[i]==W[j]:
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
W=[]
for i in range(N):
  W.append(input())
for i in range(N-1):
  if W[i][-1] != W[i+1][0]:
    print('No')
    return
  for j in range(i+1, N):
    if W[i]==W[j]:
      print('No')
      return
print('Yes')
Problem p03262 (python)

Fixed submission:
def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr

    # データの状態に左右されないためにrandom.choice()を用いることもある。
    # ref = random.choice(arr)
    ref = arr[0]
    ref_count = 0

    for ele in arr:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = quick_sort(left)
    right = quick_sort(right)
    return left + [ref] * ref_count + right

def LCM(m,n):
  if m>n:
    m,n=n,m
  for i in range(1,m+1)[::-1]:
    if n%i==0:
      return i
    
N,X=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
x=[X]+x
x=quick_sort(x)
D=abs(x[1]-x[0])
for i in range(N):
  D=LCM(D,abs(x[i+1]-x[i]))
print(D)

Buggy submission (verdict: Runtime Error):
def LCM(m,n):
  for i in range(1,m+1)[::-1]:
    if n%i==0:
      return i
    
N,X=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
x=[X]+x
D=x[1]-x[0]
for i in range(N):
  D=LCM(D,x[i+1]-x[i])
print(D)
Problem p03263 (python)

Fixed submission:
H,W=(int(i) for i in input().split(' '))
a=[]
log=[]
n=0
for h in range(H):
  a.append([int(i) for i in input().split(' ')])
for h in range(H)[::2]:
  for w in range(W-1):
    if a[h][w]%2!=0:
      a[h][w]-=1
      a[h][w+1]+=1
      log.append([h+1,w+1,h+1,w+2])
      n+=1
  if h+1 != H:
    if a[h][W-1]%2!=0:
      a[h][W-1]-=1
      a[h+1][W-1]+=1
      log.append([h+1,W,h+2,W])
      n+=1
  else:
    break
  for w in range(1,W)[::-1]:
    if a[h+1][w]%2!=0:
      a[h+1][w]-=1
      a[h+1][w-1]+=1
      log.append([h+2,w+1,h+2,w])
      n+=1
  if h+2 != H:
    if a[h+1][0]%2!=0:
      a[h+1][0]-=1
      a[h+2][0]+=1
      log.append([h+2,1,h+3,1])
      n+=1
print(n)
for data in log:
  print('{0[0]} {0[1]} {0[2]} {0[3]}'.format(data))

Buggy submission (verdict: Runtime Error):
H,W=(int(i) for i in input().split(' '))
a=[]
log=[]
n=0
for h in range(h):
  a.append([int(i) for i in input().split(' ')])
for h in range(H)[::2]:
  for w in range(W-1):
    if a[h][w]%2!=0:
      a[h][w]-=1
      a[h][w+1]+=1
      log.append([h+1,w+1,h+1,w+2])
      n+=1
  if h+1 != H:
    if a[h][W-1]%2!=0:
      a[h][W-1]-=1
      a[h+1][W-1]+=1
      log.append([h+1,W,h+2,W])
      n+=1
  else:
    break
  for w in range(1,W)[::-1]:
    if a[h+1][w]%2!=0:
      a[h+1][w]-=1
      a[h+1][w-1]+=1
      log.append([h+2,w+1,h+2,w])
      n+=1
  if h+2 != H:
    if a[h+1][0]%2!=0:
      a[h+1][0]-=1
      a[h+2][0]+=1
      log.append([1,h+2,1,h+3])
      n+=1
print(n)
for data in log:
  print(data.join(' '))
Problem p03273 (python)

Fixed submission:
H,W=(int(i) for i in input().split(' '))
grid=[]
delete_count= 0
pop_count=0
for h in range(H):
  tmp = [char for char in input()]
  if tmp.count('#')!=0:
    grid.append(tmp)
  else:
    delete_count += 1
for w in range(W):
  check = 0
  for h in range(H-delete_count):
    if grid[h][w-pop_count]=='#':
      check = 1
  if check == 0:
    for h in range(H-delete_count):
      del grid[h][w-pop_count]
    pop_count+=1
for h in range(H-delete_count):
  grid[h]=''.join(grid[h])
  print(grid[h])

Buggy submission (verdict: Runtime Error):
H,W=(int(i) for i in input().split(' '))
grid=[]
for h in range(H):
  tmp = input()
  if tmp.count('#')!=0:
 	grid[h]=tmp
  else:
    H -= 1
pop_count=0
for w in range(W):
  check = 0
  for h in range(h):
    if grid[h][w-pop_count]='#':
      check = 1
  if check == 0:
    for h in range(H):
		grid[h].pop(w-pop_count)
    pop_count+=1
for h in range(H):
  print(grid[h])
Problem p03274 (python)

Fixed submission:
N,K=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
time=None
index=0
l=len(x)
while True:
  if x[index]==0:
    K-=1
    x.remove(index)
  elif x[index]>0:
    break
  index+=1
  if index==l:
    break
x.insert(index,0)
if K==0:
  time=0
for i in range(max(0,K-len(x)+index+1),min(K+1,index+1)):
  if -x[index-i]>x[index+K-i]:
    time_tmp=-x[index-i]+2*x[index+K-i]
  else:
    time_tmp=-2*x[index-i]+x[index+K-i]
  if time==None:
    time=time_tmp
  if time_tmp<time:
    time=time_tmp
print(time)

Buggy submission (verdict: Runtime Error):
N,K=(int(i) for i in input().split(' '))
x=[int(i) for i in input().split(' ')]
time=None
index=0
while True:
  if x[index]==0:
    K-=1
    x.remove(index)
  elif x[index]>0:
    break
  index+=1
  if index==len(x):
    break
x.insert(index,0)
for i in range(max(0,K-len(x)+index+1),min(K+1,index+1)):
  if -x[index-i]>x[index+K-i]:
    time_tmp=-x[index-i]+2*x[index+K-i]
  else:
    time_tmp=-2*x[index-i]+x[index+K-i]
  if time==None:
    time=time_tmp
  if time_tmp<time:
    time=time_tmp
print(time)
Problem p03280 (python)

Fixed submission:
print(eval("("+input().replace(" ", "-1)*(")+"-1)"))

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
print(eval("("+input().replace(" ", "-1)(")+"-1)"))
Problem p03281 (python)

Fixed submission:
def factorize(n):
  factors=[1]
  i=2
  while n>1:
    if n%i==0:
      factors.append(i)
    if i==n:
      break
    else:
      i+=1
  return factors
      
n=int(input())
nums=[]
for i in range(1,n+1):
  if i%2==1:
    if len(factorize(i))==8:
      nums.append(i)
print(len(nums))

Buggy submission (verdict: Runtime Error):
n=int(input())
nums=[]
for i in range(1,n):
  if factorize(n).len()==8
  nums.append(i)
print(nums.len())


def factorize(n):
  i=2
  facors=[1]
  while True:
    if n%i==0:
      factors.append(i)
    else:
      i+=1
    if i==n:
      break
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s[1:]
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s[0]=='1':
  count_1+=1
  s=s.lstrip('1')
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

count_1=0
while s[0]=='1':
  count_1+=1
  s=s.lstrip('1')
if count_1>=k:
  print('1')
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s=input()
S=''
k=int(input())
for num in s:
  S+=num*(int(num)**5000000000000000)
print(S[k])
Problem p03292 (python)

Fixed submission:
a=[int(i) for i in input().split(" ")]
a.sort()
print(a[2]-a[0])

Buggy submission (verdict: Runtime Error):
a=(int(i) for i in input().sprit(" "))
a.sorted()
print(a[2]-a[0])
Problem p03293 (python)

Fixed submission:
s=input()
t=input()
for i in range(len(s)):
  tmp=s[i:]+s[:i]
  if tmp==t:
    print('Yes')
    exit()
print('No')

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
for i in len(s):
  tmp=s[i:]+s[:i]
  if tmp==t:
    print('Yes')
    exit()
print('No')
Problem p03308 (python)

Fixed submission:
n=input()
a=[int(i) for i in input().split(' ')]
a.sort()
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
n=input()
a=[int(i) for i in input().split(' ')]
a.sort()
print(a[N-1]-a[0])
Problem p03311 (python)

Fixed submission:
N=int(input())
A=[int(i) for i in input().split(' ')]
for i in range(len(A)):
  A[i]-=i+1
A.sort()
if len(A)%2==1:
  b=A[(len(A)-1)//2]
else:
  b=A[(len(A))//2-1]
s=0
for i in range(len(A)):
  s+=abs(A[i]-b)
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(i) for i in input().split(' ')]
for i in range(len(A)):
  a[i]-=i+1
if len(A)%2==1:
  b=(len(A)-1)//2
else:
  b=(len(A))//2-1
s=0
for i in range(len(A)):
  s+=abs(A[i]-(b+i))
print(s)

Buggy submission (verdict: Runtime Error):
def func(A,b):
  s=0
  for i in range(len(A)):
    s+=abs(A[i]-(b+i))
  return s

N=int(input())
A=[int(i) for i in input().split(' ')]
min=None
for b in range(A[0],A[-1]-len(A)+1):
  if min=None:
    min=func(A,b)
  elif min>func(A,b):
    min=func(A,b)
print(min)
Problem p03325 (python)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split(' ')]
for i in range(n):
  j=0
  while(True):
    if a[i]%2==0:
      j+=1
      a[i]=a[i]//2
    else:
      a[i]=j
      break
print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(i) for i in input().split(' ')]
div2=a
for i in range(n):
  j=0
  while(True):
    if div2[i]%2==0:
      j+=1
      div2=div2[i]//2
    else:
      div2[i]=j
      break
print(sum(div2))
Problem p03377 (python)

Fixed submission:
a,b,x=(int(i) for i in input().split(' '))
print("YES" if a<=x and x<=a+b else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,x=(int(i) for i in input.split(' '))
print("YES" if a<=x and x<=a+b else 'NO')
Problem p03378 (python)

Fixed submission:
n,m,x=(int(i) for i in input().split(' '))
a=[int(i) for i in input().split(' ')]
a+=[x]
a.sort()
print(min(a.index(x),m-a.index(x)))

Buggy submission (verdict: Runtime Error):
n,m,x=(int(i) for i in input().split(' '))
a=[int(i) for i in input().split(' ')]
if x<a[0]:
  print('0')
else:
  for i in range(len(m)):
    if a[i]<x:
      print(min(i+1,m-i-1))
      break
Problem p03385 (python)

Fixed submission:
S=input()
print('Yes' if S.count('a')*S.count('b')*S.count('c')==1 else 'No')

Buggy submission (verdict: Runtime Error):
S=inout()
print('Yes' if S.count('a')*S.count('b')*S.count('c')==1 else 'No')
Problem p03399 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=(int(i) for i in input().split(' '))
print(min(a,b)+min(c,d))
Problem p03415 (python)

Fixed submission:
s=str()
s+=input()[0]
s+=input()[1]
s+=input()[2]
print(s)

Buggy submission (verdict: Runtime Error):
s[0]=input()[0]
s[1]=input()[1]
s[2]=input()[2]
print(s)
Problem p03455 (python)

Fixed submission:
print('Odd' if eval(input().replace(' ','*'))%2!=0 else 'Even')

Buggy submission (verdict: Runtime Error):
print('Odd' if eval(input().replace(' ','*')%2!=0 else 'Even')

Buggy submission (verdict: Runtime Error):
print('Odd' if eval(input().replace(' ','*') else 'Even')
Problem p03485 (python)

Fixed submission:
import math
print(math.ceil(eval('('+input().replace(' ', '+')+')/2')))

Buggy submission (verdict: Runtime Error):
print(eval('('+input().replace(' ', +)+')//2'))
Problem p03501 (python)

Fixed submission:
n,a,b=(int(i) for i in input().split(' '))
print(min(a*n,b))

Buggy submission (verdict: Runtime Error):
n,a,b=(int(i) for i in input().split(' '))
print(nin(a*n,b))
Problem p03543 (python)

Fixed submission:
n=input()
if (n[0]==n[1] and n[1]==n[2]) or (n[1]==n[2] and n[2]==n[3]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=input()
if (n[0]==n[1] and n[1]=n[2]) or (n[1]==n[2] and n[2]==n[3]):
  print('Yes')
else:
  print('No')
Problem p03547 (python)

Fixed submission:
x=[i for i in input().split(' ')]
if x[0]==x[1]:
  print('=')
else:
  tmp=x[0]
  x.sort()
  if x[0]==tmp:
    print('<')
  else:
    print('>')

Buggy submission (verdict: Runtime Error):
x=[input().split(' ')]
if x[0]==x[1]:
  print('=')
elif:
  tmp=x[0]
  x.sort()
  if x[0]==tmp:
    print('<')
  else:
    print('>')
Problem p03555 (python)

Fixed submission:
c=[]
c.append(input())
c.append(input())
for i in range(3):
  if c[0][i]!=c[1][2-i]:
    print('NO')
    exit()
print('YES')

Buggy submission (verdict: Runtime Error):
c=[[]]
c[0].append(input())
c[1].append(input())
for i in range(3):
  if c[0][i]!=c[1][2-i]:
    print('NO')
    exit()
print('YES')
Problem p03760 (python)

Fixed submission:
o=input()
e=input()
s=""
for i in range(len(o)):
  if len(e) == i:
    s+=o[i]
  else:
    s+=o[i]+e[i]
print(s)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
s=""
for i in range(len(o)):
  if not e[i]:
    s+=o[i]
  else:
    s+=o[i]+e[i]
print(s)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
s=""
for i in range(len(o)):
  if not e[i]:
    s+=o[i]+e[i]
  else:
    s+=o[i]
print(s)
Problem p02675 (python)

Fixed submission:
N = int(input())%10
yomi = {0:"pon",1:"pon",2:"hon",3:"bon",4:"hon",5:"hon",6:"pon",7:"hon",8:"pon",9:"hon"}
print(yomi[N])

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()

if(len(S)<=K):
    print(S)
else:
    print(S[0:K] + "...")

Buggy submission (verdict: Runtime Error):
N = int(input())%10;
if(N == 2 or N == 4 or N == 5 or N ==7 or N== 9)
    print(hon)
elif(N == 0 or N ==1 or N ==8 or N ==6) 
    print(pon)
else
    print(bon);
Problem p02675 (python)

Fixed submission:
n=int(input())
p=n%10
if p in [2,4,5,7,9]:
  print("hon")
elif p in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
n=int(input())
p=n%10
if p in [2,4,5,7,9]:
  return "hon"
elif p in [0,1,6,8]:
  return "pon"
return "bon"
Problem p03337 (python)

Fixed submission:
a,b=list(map(int,input().split()))
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a,b=list(int(input().split()))
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a,b=list(int(input().split()))
print(max(a+b,a-b,a*b)
Problem p03399 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
l=[int(input())for _ in range(4)]
print(min((l[0],l[1]),(l[2],l[3]))

Buggy submission (verdict: Runtime Error):
l=[int(input())for _ in range(4)]
print(min(l[0],l[1])+min(l[3],l[4]))
Problem p03436 (python)

Fixed submission:
from collections import deque
h,w=map(int,input().split())
maplis=[input() for i in range(h)]

que=deque([(0,0,1)])
used={(0,0)}
bcount =sum(s.count("#") for s in maplis)


def check(x,y,c):
    if x<0 or x>w-1 or y<0 or y>h-1:
        return
    if maplis[y][x]=="#":
        return
    if  (x,y) in used:
        return
    que.append((x,y,c+1))
    used.add((x,y))

f=-1
while que:
    x,y,c=que.popleft()
    if x==w-1 and y==h-1:
        f=c
        break
    check(x-1,y,c)
    check(x+1,y,c)
    check(x,y-1,c)
    check(x,y+1,c)
print(f if f==-1 else(h*w-f-bcount))

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

que=[[0,0,1]]
used=[[0,0]]
bcount =0
for i in maplis:
    bcount+=i.count("#")


def check(x,y,c):
    f=(x<0 or x>w-1 or y<0 or y>h-1)
    f=(f or maplis[y][x]=="#")
    f=(f or [x,y] in used)
    if not f:
        que.append([x,y,c+1])

f=-1
while que:
    x,y,c=que.pop(0)
    if x==w-1 and y==h-1:
        f=c
    used.append([x,y])
    check(x-1,y,c)
    check(x+1,y,c)
    check(x,y-1,c)
    check(x,y+1,c)
print(f if f==-1 else(h*w-f-bcount))
h,w=map(int,input().split())
maplis=[input() for i in range(h)]

que=[[0,0,1]]
used=[[0,0]]
bcount =0
for i in maplis:
    bcount+=i.count("#")


def check(x,y,c):
    f=(x<0 or x>w-1 or y<0 or y>h-1)
    f=(f or maplis[y][x]=="#")
    f=(f or [x,y] in used)
    if not f:
        que.append([x,y,c+1])

f=-1
while que:
    x,y,c=que.pop(0)
    if x==w-1 and y==h-1:
        f=c
    used.append([x,y])
    check(x-1,y,c)
    check(x+1,y,c)
    check(x,y-1,c)
    check(x,y+1,c)
print(f if f==-1 else(h*w-f-bcount))