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

Fixed submission:
N=int(input())
cnt=0
L=[3*5*7,3*5*9,3*5*11,3*5*13,3*7*9]
for l in L:
  cnt+=(l<=N)
print(cnt)

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    if n=1:
      return 1
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if __name__=='__main__':
  print(prime_factorize(N))
Problem p03284 (python)

Fixed submission:
n,k=map(int,input().split())
if n%k==0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%4==0 or N%7==0:
  print('Yes')
else:
  while 0<N:
    N-=7
    if N%4==0:
      print('Yes')
      break
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k=map(int,print().split())
if n%k==0:
  print(0)
else:
  print(1)
Problem p03285 (python)

Fixed submission:
N=int(input())
if N%4==0 or N%7==0:
  print('Yes')
else:
  while 7<N:
    N-=7
    if N%4==0:
      print('Yes')
      break
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%4==0 or N%7==0:
  print('Yes')
elif:
  while 0<N:
    N-=7
    if N%4:
      print('Yes')
      break
  else:
    print('No')
Problem p03289 (python)

Fixed submission:
word=input()
cflg=True
if word[0]!='A':
  cflg=False
elif word[2:-1].count('C')!=1:
  cflg=False
cnt=0
for l in word[1:]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
word=input()
cflg=True
if word[0]!=A:
  cflg=False
elif word[2:-2].count('C'):
  cflg=False
cnt=0
for l in word[1:-1]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WC')
Problem p03292 (python)

Fixed submission:
A=list(map(int,input().split()))
A.sort()
res=0
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=res+A[i]-A[i-1]
print(res)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if i==0:
    continue
  else:
    res=res+A[i]-A[i-1]
print(res)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if i=0:
    continue
  else:
    res=A[i]-A[i-1]
print(res)
Problem p03294 (python)

Fixed submission:
N=input()
a=list(map(int,input().split()))
print(sum([i-1 for i in a]))

Buggy submission (verdict: Runtime Error):
N=input()
a=list(map(int,input().split()))
print(sum(a-1))
Problem p03323 (python)

Fixed submission:
a, b =map(int, input().split())
print('Yay!' if a<=8 and b <= 8 else ':(')

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

c = abs(a-b)
print('Yey!' if c<=2 else ':(')
Problem p03061 (python)

Fixed submission:
import sys
from fractions import gcd

def input():
	return sys.stdin.readline()

N = int(input())
A = [int(_) for _ in input().split()]
p1 = [0] * N
p2 = [0] * N

p1[0] = A[0]
p2[-1] = A[-1]

for i in range(1, N):
	p1[i] = gcd(p1[i-1], A[i])
	p2[-(i+1)] = gcd(p2[-i], A[-(i+1)])

m = max(p1[-2], p2[1])

if N > 2:
	for i in range(1, N-1):
		m = max(m, gcd(p1[i-1], p2[i+1]))

print(m)

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

def input():
	return sys.stdin.readline()

N = int(input())
A = [int(_) for _ in input().split()]
p1 = [0] * N
p2 = [0] * N

p1[0] = A[0]
p2[-1] = A[-1]

for i in range(1, N):
	p1[i] = gcd(p1[i-1], A[i])
	p2[-(i+1)] = gcd(p2[-i], A[-(i+1)])

m = max(p1[-2], p2[1])

if N > 2:
	for i in range(1, N-1):
		m = max(m, gcd(p1[i-1], p2[i+1]))

print(m)
Problem p03112 (python)

Fixed submission:
import sys
from bisect import bisect_right
input = sys.stdin.readline
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
xs = [int(input()) for i in range(Q)]
for x in xs:
    b, d = bisect_right(s, x), bisect_right(t, x)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)

Buggy submission (verdict: Runtime Error):
import sys
from bisect import bisect_right
input = sys.stdin.readline().strip()
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
xs = [int(input()) for i in range(Q)]
for x in xs:
    b, d = bisect_right(s, x), bisect_right(t, x)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = [int(x) for x in input().split()]

res = 'Yes'
for i in range(N):
	if L[i] >= sum(L[:i]) + sum(L[i + 1:]):
		res = 'No'

print(res)

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# import math
# import random
# from collections import Counter, defaultdict, deque
# from decimal import Decimal
# from functools import lru_cache, reduce
# from itertools import combinations, combinations_with_replacement, product, permutations
# from operator import add, mul, sub, itemgetter
# import numpy as np

import sys
sys.setrecursionlimit(10000)

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def read_int(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [int(x) for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret

def read_float(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [float(x) for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret
	
def read_str(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [x for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret
		
@mt
def slv(*args): 
	# 処理
	# ここから
	
	if max(L) < sum(L) - max(L):
		ans = 'Yes'
	else:
		ans = 'No'
	
	# ここまで
	return ans

if __name__ == '__main__':
	
	# テスト用入力
	t = '''4
3 8 5 1'''.splitlines()
	
	# 入力 (変数= read_xxx(test[行数]))
	# ここから
	
	N = read_int()
	L = read_int()
	
	# ここまで
		
	# 出力
	# ここから
	
	print(slv(N, L))
	
	# ここまで

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(x) for x in input().split()]

res = 'Yes'
for i in range(N):
	if L[i] >= sum(L[:i]) + sum(L[i + 1:]):
		res = 'No'

print(res
Problem p03141 (python)

Fixed submission:
N = int(input())
A = [0] * N
B = [0] * N
Sum = [[0] * 2 for i in range(N)]

for i in range(N):
    A[i], B[i] = map(int, input().split())
    Sum[i][0] = i
    Sum[i][1] = A[i] + B[i]
    
a = 0
b = 0
turn = 0

Sum.sort(key=lambda x:x[1], reverse=True)
    
for i in range(N):
    if turn == 0:
        a += A[Sum[i][0]]
        turn = 1
    else:
        b += B[Sum[i][0]]
        turn = 0

print(a - b)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
L = [[0] * 3 for _ in range(N)]

for i in range(N):
    L[i][0], L[i][1] = [int(i) for i in input().split()]
    L[i][2] = L[i][0] + L[i][1]

L.sort(key=lambda x:x[2], reverse=True)

print(sum(L[::2][0]) - sum(L[1::2][1]))
Problem p03160 (python)

Fixed submission:
N = int(input())
h = [int(i) for i in input().split()]

dp = [0] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, N):
    dp_1 = dp[i-2] + abs(h[i]-h[i-2])
    dp_2 = dp[i-1] + abs(h[i]-h[i-1])
    dp[i] = min(dp_1, dp_2)
    
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
h = np.ndarray(input().split(), dtype='int32')
dp = np.zeros(N, dtype='int32')

dp[1] = np.abs(h[1]-h[0])
if N > 2:
    for i in range(2, N):
        dp[i] = np.min(dp[i-2:i] + np.abs(h[i]-h[i-2:i]))

print(dp[-1])
Problem p03161 (python)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()
    
N, K = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

dp = [float('inf')] * N
dp[0] = 0
for i in range(1, N):
    for k in range(1, min(K+1, i+1)):
        dp[i] = min(dp[i], dp[i-k]+abs(h[i]-h[i-k]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline()
    
N, K = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

dp = [float('inf')] * N
dp[0] = 0
for i in range(1, N):
    for k in range(1, min(K+1, i):
        dp[i] = min(dp[i], dp[i-k]+abs(h[i]-h[i-k]))
print(dp[N-1])
Problem p03251 (python)

Fixed submission:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion

N, M, X, Y = ri_()
x = ri_()
y = ri_()
ans = 'War'
for Z in range(-100, 101):
    if X < Z <= Y and max(x) < Z and min(y) >= Z:
        ans = 'No War'
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split())).append(X)
y = list(map(int, input().split())).append(Y)
if max(x)<min(y):
	print('War')
else:
	print('No War') 3 N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
y = list(map(int, input().split()))
y.append(Y)

if max(x)<min(y):
	print('War')
else:
	print('No War')

Buggy submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split())).append(X)
y = list(map(int, input().split())).append(Y)
if max(x)<min(y):
	print('War')
else:
	print('No War')

Buggy submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split())).append(X)
y = list(map(int, input().split())).sppend(Y)
if max(x)<min(y):
	print('War')
else:
	print('No War')
Problem p03309 (python)

Fixed submission:
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])
A = np.sort(A - np.arange(N) - 1)
b = A[N//2]
print(np.sum(np.abs(A - b)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()], 
             dtype = 'int64')
A = A - np.arange(N) - 1
B = np.abs(A - np.reshape(A, (-1, 1)))
print(np.sum(B, axis=1).min())

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])
A = A - np.arange(N) - 1
B = np.abs(A - np.reshape(A, (-1, 1)))
print(np.sum(B, axis=1).min())

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])
A = A - np.arange(N) - 1
B = A - np.reshape(A, (-1, 1))
print(np.sum(B, axis=1).max())
Problem p03316 (python)

Fixed submission:
N = input()
S = 0
for i in N:
    S += int(i)

if int(N) % S == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# AtCoder Beginner Contest 101
# B - Digit Sums

from sys import stdin
input = stdin.readline

N = input()
S = 0
for i in N:
    S += int(i)

if int(N) % S == 0:
    print('Yes')
else:
    print('No')
Problem p03420 (python)

Fixed submission:
n, k = map(int,input().split())
a=0
for i in range(1,n+1):
  a+=max(0,i-k)*(n//i)+max(0,n%i-k+1)
if k==0:
  a-=n
print(a)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
for i in range(1,n):
  a=max(0,i-k)*(n//b)+max(0,n%i-k+1)
if k==0:
  a-=n
print(a)
Problem p03424 (python)

Fixed submission:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N = ri()
S = list(Counter(rs_()))
print('Three' if len(S) == 3 else 'Four')

Buggy submission (verdict: Runtime Error):
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N = ri()
S = list(Counter(ri_()))
print('Three' if len(S) == 3 else 'Four')
Problem p03471 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()
def read(): return int(input())
def reads(): return [int(i) for i in input().split()]

N, Y = reads()

x_max = min(N, Y//10000)
y_max = min(N, Y//5000)

ans = (-1, -1, -1)

for x in range(x_max+1):
	for y in range(min(y_max+1, N-x+1)):
		if 10000*x + 5000*y + 1000*(N-x-y) == Y:
			ans = (x, y, N-x-y)
			break

print(str(ans[0])+' '+str(ans[1])+' '+str(ans[2]))

Buggy submission (verdict: Runtime Error):
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]
N, Y = ri_()
for i in range(N + 1):
    for j in range(N + 1):
        if 1000 * (N - i - j) == Y - 10000 * i - 5000 * j and N - i - j >= 0:
            print(i, j, N - i - j)
            exit()
print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()
def read(): return int(input())
def reads(): return [int(i) for i in input().split()]

N, Y = reads()

y_max = min(N, Y//10000)
i_max = min(N, Y//5000)
h_max = min(N, Y//1000)

ans = (-1, -1, -1)

for y in range(y_max+1):
	for i in range(i_max+1):
		for h in range(h_max+1):
			if 10000*y + 5000*i + 1000*h == Y:
				ans = (y, i, h)
				break

print(ans[0]+' '+ans[1]+' '+ans[2])
Problem p03501 (python)

Fixed submission:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N, A, B = ri_()
print(min(A * N, B))

Buggy submission (verdict: Runtime Error):
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N, A, B = ri()
print(min(A * N, B))
Problem p03545 (python)

Fixed submission:
a, b, c, d = [int(i) for i in input()]
for op1 in ['+', '-']:
    for op2 in ['+', '-']:
        for op3 in ['+', '-']:
            ans = a
            if op1 == '+':
                ans += b
            else:
                ans -= b
            if op2 == '+':
                ans += c
            else:
                ans -= c
            if op3 == '+':
                ans += d
            else:
                ans -= d
            if ans == 7:
                print(str(a) + op1 + str(b) + op2 + str(c) + op3 + str(d) + '=7')
                exit()

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
for op1 in ['+', '-']:
    for op2 in ['+', '-']:
        for op3 in ['+', '-']:
            ans = a
            if op1 == '+':
                ans += b
            else:
                ans -= b
            if op2 == '+':
                ans += c
            else:
                ans -= c
            if op3 == '+':
                ans += d
            else:
                ans -= d
            if ans == 7:
                print(str(a) + op1 + str(b) + op2 + str(c) + op3 + str(d) + '=7')
                exit()

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
for op1 in ['+', '-']:
    for op2 in ['+', '-']:
        for op3 in ['+', '-']:
            ans = a
            if op1 == '+':
                ans += b
            else:
                ans -= b
            if op2 == '+':
                ans += c
            else:
                ans -= c
            if op3 == '+':
                ans += d
            else:
                ans -= d
            if ans == 7:
                print(str(a) + op1 + str(b) + op2 + str(c) + op3 + str(d))
                exit()
Problem p03760 (python)

Fixed submission:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

o = rs()
e = rs()
ans = ''
for i in range(len(o)):
    ans += o[i]
    if i < len(e):
        ans += e[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

import numpy as np
v = np.stack([np.array(list(rs()),dtype=object), np.array(list(rs()),dtype=object)])
v = v.T.flatten()
print(''.join(v))
Problem p02953 (python)

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

No_flag = 0
for i in range(n-1, 0, -1) : 
    if H[i] >= H[i-1] : 
        pass
    elif H[i-1] - H[i] == 1 : 
        H[i-1] -= 1
    elif H[i-1] - H[i] >= 2 : 
        No_flag = 1
        break
    
if No_flag == 1 : 
    print("No")
else : 
    print("Yes")

Buggy submission (verdict: Runtime Error):
# input
n = int(input())
H = list(map(int, input().split()))
dec_L = []
S = []

# classify
for i in range(n-1) : 
    # increase
    if H[i] < H[i+1] : 
        inc_flag = 1
        dec_flag = 0 
    # decrease
    elif H[i] > H[i+1] : 
        dec_flag = 1
        inc_flag = 0    
    # remain
    elif H[i] == H[i+1] and inc_flag == 1 : 
        pass
    elif H[i] == H[i+1] and dec_flag == 1 : 
        pass
    
    dec_L.append(dec_flag)
    
# make new list
for i in range(len(dec_L)-1) : 
    if dec_L[i] == 0 and dec_L[i+1] == 1 : 
        p_cut = i
    elif dec_L[i] == 1 and dec_L[i+1] == 0 and p_cut >= 0 : 
        S.append(H[p_cut+1:i+2])
    elif i == len(dec_L)-2 and dec_L[len(dec_L)-2] == 1 and dec_L[len(dec_L)-1] == 1 : 
        S.append(H[p_cut+1:i+3])

# exe
NO_flag = 0
for s in S : 
    if max(s) - min(s) >= 2 : 
        NO_flag = 1
        
if NO_flag == 1 : 
    print("No")
else : 
    print("Yes")

# # confirm
# print(H)    
# print(dec_L)
# print(S)
Problem p02760 (python)

Fixed submission:
L_yoko = [list(map(int,input().split())) for _ in range(3)]


L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

n = int(input())
ans = [int(input()) for _ in range(n)]

a = int(0)
for z in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break


if a == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
L_yoko = [list(map(int,input().split())) for i in range(3)]

n = 9
ans = [int(input()) for _ in range(n)]

L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

a = int(0)
for z in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

if a == 0:
    print("No")
else:
    print("Yes")

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

ans = [int(input()) for _ in range(9)]


L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

a = int(0)
for x in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break
    else:
        continue

for y in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break
    else:
        continue

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break
    else:
        continue


if a == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
L_yoko = []
for i in range(3):
     x = list(map(int,input().split()))
     L_yoko.append(x)

ans = []
for i in range(9):
     x = int(input())
     ans.append(x)


L_tate = list(zip(*L_yoko))

L_naname = []
L_naname.append([L_yoko[0][0],L_yoko[1][1],L_yoko[2][2]])
L_naname.append([L_yoko[0][2],L_yoko[1][1],L_yoko[2][0]])

a = int(0)
for z in L_tate:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_yoko:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break

for z in L_naname:
    if z[0] in ans and z[1] in ans and z[2] in ans:
         a = 1
         break


if a == 1:
    print("Yes")
else:
    print("No")