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

Fixed submission:
import math

N = int(input())
X_double = N / 1.08
if (X_double % 1) == 0:
  print(int(X_double))
else:
  X_ceil = math.ceil(X_double)
  if math.floor(X_ceil * 1.08) == N:
    print(X_ceil)
  else:
    print(':(')

Buggy submission (verdict: Runtime Error):
N = int(input())
X_double = N / 1.08
if (X_double % 1) == 0:
  print(int(X_duoble))
else:
  X_ceil = ceil(X_double)
  if floor(X_ceil * 1.08) == N:
    print(X_ceil)
  else:
    print(':(')
Problem p03138 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def calcans(ans, a_list):  
  sm = 0
  for a in a_list:
    sm += a^ans
  print(sm)

def solve():
  N, K = LI()
  a_list = LI()
  if K == 0:
    calcans(0, a_list)
    return
  # Kの可能な最大桁（1オリジン）
  import math
  nk = math.floor(math.log2(K)) + 1
  bink = '{0:050b}'.format(K)
  bin_list = []
  for a in a_list:
    bin_list.append('{0:050b}'.format(a))

  # 最大の桁から順に決める nk桁目～1桁目
  bind = True
  ans = ''
  for i in range(nk, 0, -1):
    n1 = 0
    for b in bin_list:
      # i桁目の数字は string の index で見て -i
      if b[-i] == '1':
        n1 += 1

    if n1 > N // 2:
      optimal = '0'
    else:
      optimal = '1'

    if bink[-i] == '1':
      ans += optimal
      if optimal == '0':
        bind = False
    else:
      if bind == True:
        ans += '0'
      else:
        ans += optimal

  ansint = int(ans, 2)
  calcans(ansint, a_list)
  
solve()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def calcans(ans, a_list):  
  sm = 0
  for a in a_list:
    sm += a^ans
  print(sm)

def solve():
  N, K = LI()
  a_list = LI()
  if K == 0:
    calcans(0, a_list)
    return
  # Kの可能な最大桁（1オリジン）
  import math
  nk = math.floor(math.log2(K)) + 1
  bink = '{0:030b}'.format(K)
  bin_list = []
  for a in a_list:
    bin_list.append('{0:030b}'.format(a))

  # 最大の桁から順に決める nk桁目～1桁目
  bind = True
  ans = ''
  for i in range(nk, 0, -1):
    n1 = 0
    for b in bin_list:
      # i桁目の数字は string の index で見て -i
      if b[-i] == '1':
        n1 += 1

    if n1 > N // 2:
      optimal = '0'
    else:
      optimal = '1'

    if bink[-i] == '1':
      ans += optimal
      if optimal == '0':
        bind = False
    else:
      if bind == True:
        ans += '0'
      else:
        ans += optimal

  ansint = int(ans, 2)
  calcans(ansint, a_list)
  
solve()
Problem p03435 (python)

Fixed submission:
def solve():
    c = []
    c.append(list(map(int, input().split())))
    c.append(list(map(int, input().split())))
    c.append(list(map(int, input().split())))

    a0_list = range(c[0][0]+1)

    for a0 in a0_list:
        b0 = c[0][0] - a0
        b1 = c[0][1] - a0
        b2 = c[0][2] - a0

        a1 = c[1][0] - b0
        a2 = c[2][0] - b0

        if c[1][1] != a1 + b1:
            continue
        if c[1][2] != a1 + b2:
            continue
        if c[2][1] != a2 + b1:
            continue
        if c[2][2] != a2 + b2:
            continue
        print("Yes")
        return

    print("No")
    return

solve()

Buggy submission (verdict: Runtime Error):
def solve():
    c = []
    c.append(map(int, input().split()))
    c.append(map(int, input().split()))
    c.append(map(int, input().split()))

    a1_list = range(c[0][0]+1)
    for a1 in a1_list:
        b1 = c[0][0] - a1
        b2 = c[0][1] - a1
        b3 = c[0][2] - a1

        a2 = c[1][0] - b1
        a3 = c[2][0] - b2

        if c[1][1] != a2 + b2:
            continue
        if c[1][2] != a2 + b3:
            continue
        if c[2][1] != a3 + b2:
            continue
        if c[2][2] != a3 + b3:
            continue
        print("Yes")
        return

    print("No")
    return

solve()
Problem p03436 (python)

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

    # for i in range(h):
    #     print(maze[i])

    nwall = 0
    for i in range(h):
        for j in range(w):
            if maze[i][j] == '#':
                nwall += 1

    q = []
    q.insert(0, (0,0))
    hist = [[0 for i in range(w)] for j in range(h)]
    hist[0][0] = 1


    while(len(q) > 0):
        x, y = q.pop()

        if x == w-1 and y == h-1:
            return h*w - nwall - hist[h-1][w-1]

        for i in range(0, 4):
            nx, ny = x+[1,0,-1,0][i], y+[0,1,0,-1][i]

            if nx<0 or nx>=w or ny<0 or ny>=h:
                continue
            if maze[ny][nx] == '#':
                continue
            if hist[ny][nx] >= 1:
                continue
            # print("x,y", x,y)
            # print("nx,ny", nx,ny)

            q.insert(0, (nx,ny))
            hist[ny][nx] = hist[y][x] + 1

    return -1


print(solve())

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

    nwall = 0
    for i in range(h):
        for j in range(w):
            if maze[i][j] == '#':
                nwall += 1

    q = []
    q.insert(0, (0,0))
    hist = [[0 for i in range(w)] for j in range(h)]


    while(len(q) > 0):
        x, y = q.pop()

        if x == w-1 and y == h-1:
            break

        for i in range(0, 4):
            nx, ny = x+[1,0,-1,0][i], y+[1,0,-1,0][i]

            if nx<0 or nx>=w or ny<0 or ny>=h:
                continue
            if maze[ny][nx] == '#':
                continue
            if hist[ny][nx] == 1:
                continue

            q.insert(0, (nx,ny))
            hist[nx][ny] = hist[x][y] + 1

    print(h*w - nwall - hist[h-1][w-1])

solve()
Problem p03472 (python)

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

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(to_throw)[::-1])
    print(len(to_throw) - len(cum[cum>=h]) + 1)
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))

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

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(b)[::-1])
    print(len(to_throw) - len(cum[cum>=h])) + 1
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))
Problem p03497 (python)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
a = list(map(int, input().split()))

def uniq(a):
    d = {}
    for a_ in a:
        if a_ not in d:
            d[a_] = 1
        else:
            d[a_] += 1
    return d.keys(), d.values()

def solve():
    u, c = uniq(a)
    k = len(u) - K
    if len(u) > K:
        print(sum(sorted(c)[:k]))
    else:
        print(0)

solve()

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
a = list(map(int, input().split()))
a = np.array(a)

def solve():
    u, c = np.unique(a, return_counts=True)
    k = len(u) - K
    if len(u) > K:
        print(np.sum(np.sort(c)[:k]))
    else:
        print(0)

solve()
Problem p03808 (python)

Fixed submission:

def solve():
    n = int(input())
    a = list(map(int, input().split()))

    one = n*(n+1)/2

    if sum(a) % one != 0:
        print("NO")
        return
    else:
        nop = sum(a) / one

    d = [0 for i in range(n)]
    for i in range(n):
        d[i] = a[(i+1)%n] - a[i]
        d[i] = d[i] - nop

    count = 0

    for i in range(n):
        if d[i] != 0:
            if d[i] % n != 0 or d[i] > 0:
                print("NO")
                return
            count = count + (-1*d[i]) / n
            d[i] = 0
            if count > nop:
                print("NO")
                return

    if sum(d) == 0 and count == nop:
        print("YES")
    else:
        print("NO")

solve()

Buggy submission (verdict: Runtime Error):

def solve():
    n = int(input())
    a = list(map(int, input().split()))

    one = n*(n+1)/2

    if sum(a) % one != 0:
        print("NO")
    else:
        nop = sum(a) / one

    d = [0 for i in range(n)]
    for i in range(n):
        d[i] = a[(i+1)%n] - a[i]
        d[i] = d[i] - nop

    count = 0

    for i in range(n):
        if d[i] != 0:
            if d[i] % n != 0:
                print("NO")
                return
            count = count + (-1*d[i]) / n
            d[i] = 0
            if count > nop:
                print("NO")
                return

    if sum(d) == 0 and count == nop:
        print("YES")
    else:
        print("NO")

solve()
Problem p03633 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

N = int(input())
T = [int(input()) for i in range(N)]

ans = 1
for value in range(0, N):
    ans = lcm(ans, T[value])

print(ans)

Buggy submission (verdict: Runtime Error):
import fraction

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

N = int(input())
T = [int(input()) for i in range(N)]

ans = 1
for value in range(0, N):
    ans = lcm(ans, T[value])

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 i in range(0, N):
    T.append(input())

ans = 1
for value in range(0, N):
    ans = lcm(ans, int(T[value]))

print(str(ans))
Problem p03399 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
import os

d = [int(input()), int(input())]
b = [int(input()), int(input())]

s = min(d) + min(b)
print(s)

Buggy submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]

d = [a[0],a[1]]
b = [a[2],a[3]]

s = min(d) + min(b)
print(s)
Problem p02743 (python)

Fixed submission:
import math
a,b,c = map(int,input().split())
l = 4*a*b
r = (c-a-b)**2
if (a+b >= c):
    print("No")
else:
    if(l < r):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input(),split())
n = math.pow((c-a-b),2)
m = 4*a*b
if(a+b >= c)
    print("No")
else
    if(n > m)
        print("Yes")
    else
        print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input(),split())
n = math.pow((c-a-b),2)
m = 4*a*b
if(a+b >= c):
    print("No")
else:
    if(n > m):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input(),split())
n = (c-a-b)**2
m = a*b*4
if(a+b >= c):
	print("No")
else:
	if(n < m):
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input(),split())
n = (c-a-b)**2
m = a*b*4
if((a+b) >= c):
	print("No")
else:
	if(n < m):
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input(),split())
n = math.pow((c-(a-b)), 2)
m = a*b*4
if((a+b) >= c):
	print("no")
else:
	if(n < m):
		print("yes")
	else:
		print("no")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(input(),split())
n = math.pow((c-(a-b)), 2)
m = a*b*4
if((a+b) >= c):
	print("no")
else:
	if(n < m):
		print("yes")
	else:
		print("no")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(input(),split())
n = math.Pow((c-(a-b)), 2)
m = a*b*4
if((a+b) >= c):
  print("no")
else:
  if(n < m):
     print("yes")
  else:
     print("no")
Problem p02850 (python)

Fixed submission:
import os
import sys
from collections import defaultdict
adj = defaultdict(list)
col = defaultdict(int)
sys.setrecursionlimit(1000000)
mx=0
edges = {}
def find_color(u , p):
	global mx , now
	cnt =0
	for i in adj[u]:
		cnt = cnt+1
		if i==p:
			continue
		find_color(i , u)
	mx = max(mx, cnt)
now =0
def dfs(u , p, prev):
	global mx, now
	for i in adj[u]:
		if i==p:
			continue
		if now == prev:
			now = (now+1)%mx
		col[edges[i,u]]=now
		now =(now+1)%mx
	for i in adj[u]:
		if i==p:
			continue
		dfs(i , u, col[edges[i, u]])

def main():
	n = int(input())
	for i in range(n-1):
		x, y = map(int , input().split())
		adj[x].append((y))
		adj[y].append((x))
		edges[x,y]=i
		edges[y,x]=i
	find_color(1, 0)
	dfs(1, 0,-1)
	print(mx)
	for i in range(n-1):
		print(col[i]+1)


if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
adj = defaultdict(list)
col = defaultdict(int)
mx=0
edges = {}
def find_color(u , p):
	global mx , now
	cnt =0
	for i in adj[u]:
		cnt = cnt+1
		if i==p:
			continue
		find_color(i , u)
	mx = max(mx, cnt)
now =0
def dfs(u , p):
	global mx, now
	for i in adj[u]:
		if i==p:
			continue
		col[edges[i,u]]=now
		now =(now+1)%mx
	for i in adj[u]:
		if i==p:
			continue
		dfs(i , u)

def main():
	n = int(input())
	for i in range(n-1):
		x, y = map(int , input().split())
		adj[x].append((y))
		adj[y].append((x))
		edges[x,y]=i
		edges[y,x]=i
	find_color(1, 0)
	dfs(1, 0)
	print(mx)
	for i in range(n-1):
		print(col[i]+1)


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

Fixed submission:
import sys
import os
sys.setrecursionlimit(1000000)
from collections import defaultdict
adj = defaultdict(list)
dis =[0 for i in range(1000000)]
def dfs(u , p):
	for i , w in adj[u]:
		if i==p:
			continue
		dis[i]=dis[u]+w
		dis[i]=dis[i]%2
		dfs(i , u)
def main():
	n = int(input())
	for i in range(n-1):
		x, y , w = map(int , input().split())
		w = w%2
		adj[x].append([y , w])
		adj[y].append([x, w])
	dfs(1, 0)
	for i in range(1,n+1):
		print(dis[i])
if __name__ =="__main__":
	main()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
adj = defaultdict(list)
dis =[0 for i in range(1000000)]
def dfs(u , p):
	for i , w in adj[u]:
		if i==p:
			continue
		dis[i]=dis[u]+w
		dis[i]=dis[i]%2
		dfs(i , u)
def main():
	n = int(input())
	for i in range(n-1):
		x, y , w = map(int , input().split())
		w = w%2
		adj[x].append([y , w])
		adj[y].append([x, w])
	dfs(1, 0)
	for i in range(1,n+1):
		print(dis[i])
if __name__ =="__main__":
	main()

Buggy submission (verdict: Runtime Error):
# code like professional " write main function"
import os
import sys
from collections import defaultdict
adj = defaultdict(list)
col = defaultdict(int)
sys.setrecursionlimit(1000000)
mx=0
edges = {}
# finding maximum color we need it would be maximum neighbouring nodes of out of all the nodes
def find_color(u , p):
	global mx , now
	cnt =0
	for i in adj[u]:
		cnt = cnt+1
		if i==p:
			continue
		find_color(i , u)
	mx = max(mx, cnt)
now =0
# now color the edges 
def dfs(u , p, prev):
	global mx, now
	for i in adj[u]:
		if i==p:
			continue
		# if current color is equivalent to previous edge color use next color
		if now == prev:
			now = (now+1)%mx
		col[edges[i,u]]=now
		now =(now+1)%mx
	for i in adj[u]:
		if i==p:
			continue
		dfs(i , u, col[edges[i, u]])

def main():
	n = int(input())
	for i in range(n-1):
		x, y = map(int , input().split())
		adj[x].append((y))
		adj[y].append((x))
		edges[x,y]=i
		edges[y,x]=i
	find_color(1, 0)
	dfs(1, 0,-1)
	print(mx)
	for i in range(n-1):
		print(col[i]+1)


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

Fixed submission:
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
  if cur == N:
    return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
  ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
  return min(ret0, ret1, ret2, ret3)
print(dfs(0, 0, 0, 0))

Buggy submission (verdict: Runtime Error):
@n, @a, @b, @c = gets.chomp.split(" ").map(&:to_i)

@l = []
@n.times do
  @l << gets.chomp.to_i
end
INF = 10**9

def dfs(cur, a, b, c)
  if cur == @n
    if [a, b, c].min > 0
      return (a - @a).abs + (b - @b).abs + (c - @c).abs - 30
    else
      return INF
    end
  end
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + @l[cur], b, c) + 10
  ret2 = dfs(cur + 1, a , b + @l[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + @l[cur]) + 10
  return [ret0, ret1, ret2, ret3].min
end

puts dfs(0, 0, 0, 0)
Problem p02747 (python)

Fixed submission:
z = input()

if z=='hi' or z=='hihi' or z=='hihihi' or z=='hihihihi' or z=='hihihihihi':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
z = input()
if z=='hi' or z=='hihi' or z=='hihihi' or z=='hihihihi' or z=='hihihihihi':
  return "Yes"
else:
  return "No"

Buggy submission (verdict: Runtime Error):
large_s = input()

con = 0
str_check = ""
for i in range(len(large_s)):
    z = large_s.find('hi', con, len(large_s))
    if (0 <= z):
        print(z)
        str_check += str(z)
        con += 2


if (str_check=='0' or str_check=='02' or str_check=='024' or str_check=='0246' or str_check=='02468'):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
 large_s = input()

        con = 0
        str_check = ""
        for i in range(len(large_s)):
            z = large_s.find('hi', con, len(large_s))
            if (0 <= z):
                print(z)
                str_check += str(z)
                con += 2


        if (str_check=='0' or str_check=='02' or str_check=='024' or str_check=='0246' or str_check=='02468'):
                print("Yes")
        else:
            print("No")
Problem p02811 (python)

Fixed submission:
k,x=(int(x) for x in input().split())

if k*500 < x:
    print("No")
else:
    print("Yes")

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

if k*500 < x:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
k = input()
x = input()

if k*500 < x:
    print("no")
else:
    print("yes")

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

if k*500 < x:
    print("No")
else:
    print("Yes")
Problem p02747 (python)

Fixed submission:
import re

def judge(check_string):

    # check length.
    if not((1 <= len(check_string)) and (len(check_string) <= 10)):
        print("No")

    # check character.
    allow_pattern = "[a-z]+"
    group = re.match(allow_pattern, check_string)

    HITACH_STRING = "^(hi){1,}$"

    if(re.match(HITACH_STRING, check_string)):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    hitachi_string = input()
    judge(hitachi_string)

Buggy submission (verdict: Runtime Error):
def judge(check_string):

    HITACH_STRING = "hi"

    if not((1 <= len(check_string)) && (len(check_string) <= 10)):
        print("No")

    if HITACH_STRING in check_string:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    hitachi_string = input()
    judge(hitachi_string)
Problem p02747 (python)

Fixed submission:
s = input()

if s == 'hi':
  print('Yes')
elif s == 'hihi':
  print('Yes')
elif s == 'hihihi':
  print('Yes')
elif s == 'hihihihi':
  print('Yes')
elif s == 'hihihihihi':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
hi = 'hi'

if hi == s:
  return "Yes"
elif hi == hi * 2:
  return "Yes"
elif hi == hi * 3:
  return "Yes"
elif hi == hi ** 4:
  return "Yes"
elif hi == hi ** 5:
  retrn "Yes"
else:
  return "No"

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

if 'hi' in s:
  return 'Yes'
else:
  return 'No'
Problem p02747 (python)

Fixed submission:
S = input()

List = ['hihi', 'hi', 'hihihi', 'hihihihi', 'hihihihihi']

if S in List:
  print('Yes')
  
else:
  print('No')

Buggy submission (verdict: Runtime Error):
count = 0
out = 0
for i in range(len(S_list)-1):
    #print(i)
    if S_list[i]=='h':
        if S_list[i+1]=='i':    
            if i+2 > len(S_list)-1:
                count += 1                
            else:
                if S_list[i+2]=='i':
                    out += 1

if count >0 and out ==0:
    print('Yes')
else:
    print('No')

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

S_list = list(S)

for i in range(len(S_list)-1):
    if S_list[i]=='h':
        if S_list[i+1]=='i':    
            try:
                letter = S_list[i+2]
            except IndexError:
                pass
                if letter!='i':                    
                    print('Yes')
                    break
else:
    print('No')

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

S_list=list(S)
for i in range(S_list):
  if S_list[i]=='h':
    if S_list[i+1] == 'i':
      if S_list[i+1] != 'i':
        print('Yes')
    
else:
  print('No')
Problem p02747 (python)

Fixed submission:
import re
s = input()
if s == "hi" or s=="hihi" or s=="hihihi" or s=="hihihihi" or s== "hihihihihi": 
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s.search("hi") != -1:
    print("Yes")
else:
    print("No")
Problem p02748 (python)

Fixed submission:
_, _, M = map(int, input().split())
# price list
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# min price
min_price = min(a_list) + min(b_list)
for _ in range(M):
  x, y, c = map(int, input().split())
  discount_price = a_list[x-1] + b_list[y-1] - c
  min_price = min(min_price, discount_price)
print(min_price)

Buggy submission (verdict: Runtime Error):
_, _, M = map(int, input().split())
# price list
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# min price
min_price = min(a_list) + min(b_list)
for _ in range(M):
  x, y, c = map(int, input().split())
  discount_price = a_list[x] + b_list[y] - c
  if discount_price < min_price:
    min_price = discount_price
print(min_price)

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
# price list
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# min price
min_price = min(a_list) + min(b_list)
for m in range(M):
  x, y, c = map(int, input().split())
  discount_price = a_list[x] + b_list[y] - c
  if discount_price < min_price:
    min_price = discount_price
print(min_price)