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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input(),split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map, int(input().split()))
yn = ["YES","NO"]
flag = 0
for i in range(n-1):
  for j in range(i+1, n):
    if i == j: 
      flag = 1
print(yn[flag])
Problem p02915 (python)

Fixed submission:
n = int(input())
print(n**3)

Buggy submission (verdict: Runtime Error):
n = int(input())
pirnt(n**3)
Problem p03075 (python)

Fixed submission:
a = int(input())
ma = a
mi = a
for i in range(4):
  x = int(input())
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi <= int(input()):
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
ma = 0
mi = 123
for i in range(5):
  x = input()
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi > input():
  print("Yay!")
else:
  print(":(")
Problem p02829 (python)

Fixed submission:
#a,b,c = map(int,input().split())
a = int(input())
b = int(input())
print(6-a-b)

Buggy submission (verdict: Runtime Error):
import fractions
A, B = map(int, input().split())
print (int(A * B // (fractions.gcd(A,B))))

Buggy submission (verdict: Runtime Error):
#a,b,c = map(int,input().split())
a = input()
b = input()
print(6-a-b)
Problem p02831 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
print (int(A * B // (fractions.gcd(A,B))))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print (int(A * B // (math.gcd(A,B))))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print((A * B) // (math.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(A * B // (math.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(A * B / (math.gcd(A,B)))
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
if(a+b+c >=22):
    print('bust')
else:
    print('win')

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

evidences = [[] for _ in range(N)]
for i in range(N):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        evidences[i].append((x-1, y))

result = 0
for i in range(1, 2**N):
    consistent = True
    for j in range(N):
        if (i >> j) & 1 == 0:
            continue
        for x, y in evidences[j]:
            if (i >> x) & 1 != y:
                consistent = False
                break
        if not consistent:
            break
    if consistent:
        result = max(result, bin(i)[2:].count('1'))
print (result)
Problem p02847 (python)

Fixed submission:
#a,b = map(int,input().split())
s = input()
S = ['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-S.index(s))

Buggy submission (verdict: Runtime Error):
A, B, X = map(int, input().split())
lb = -1
ub = X

while ub - lb > 1:
    mid = (lb + ub) // 2
    if A*mid + B*len(str(mid)) > X:
        ub = mid
    else:
        lb = mid
print(min(10**9,lb))

Buggy submission (verdict: Runtime Error):
#a,b = map(int,input().split())
s = input()
S =['SUN','MON','TUE','WEB','THU','FRI','SAT']
print(7-S.index(s))

Buggy submission (verdict: Runtime Error):
#a,b = map(int,input().split())
s = str(input())
S =['SUN','MON','TUE','WEB','THU','FRI','SAT']
print(7-S.index(s))
Problem p02933 (python)

Fixed submission:
a = int(input())
s = str(input())
if(a >= 3200):
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int,input().split()))
v.sort()
ans=v[0]
for i in v[1:]:
    ans=(ans+i)/2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int,input().split()))
v1 = v.sort()
ans=v1[0]
for i in v[1:]:
    ans=(ans+i)/2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int,input().split()))
v.sort()
ans=v[0]
for i in v[1:]:
    ans=(ans+i)/2
print(ans)
Problem p02990 (python)

Fixed submission:
from math import factorial

N, K = map(int, input().split())
MOD = 10 ** 9 + 7
for i in range(1, K + 1):
    if N-K+1 < i or K-1 < i-1:
        ans = 0
    else:
        ans = factorial(N - K + 1) // (factorial(i) * factorial(N - K + 1 - i)) * factorial(K - 1) // (
                factorial(i - 1) * factorial(K - 1 - i + 1))
    print(ans % MOD)

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

N, K = map(int, input().split())
MOD = 10 ** 9 + 7
for i in range(1, K + 1):
    ans = factorial(N - K + 1) // (factorial(i) * factorial(N - K + 1 - i)) * factorial(K - 1) // (
                factorial(i - 1) * factorial(K - 1 - i + 1))
    print(ans % MOD)
Problem p02723 (python)

Fixed submission:
a = input()
if (a[2] == a[3]) & (a[4] == a[5]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
if (a[2] == a[3]) & (a[4] == a[5]):
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
a = input()
if a[2] == a[3] && a[4] == a[5]:
  print(Yes)
else:
  print(No)
Problem p02725 (python)

Fixed submission:
k, n = map(int, input().split())
a = list(map(int, input().split()))
b = []
for l in range(len(a)-1):
  b.append(a[l+1] - a[l])
b.append(k-a[n-1]+a[0])
print(k - max(b))

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

k, n = map(int, input().split())
a = list(map(int, input().split()))
a.append(k)
b = []
for k in range(len(a)):
  b.append(a[k+1] - a[k])
print(k - argmax(b))
Problem p02729 (python)

Fixed submission:
import itertools

n,m = map(int,input().split())
comb = lambda x:x*(x-1)/2 if x >= 1 else 0
print(int(comb(n)+comb(m)))

Buggy submission (verdict: Runtime Error):
import itertools

n,m = map(int,input().split())
comb = itertools.combinations
print(comb(n,2)+comb(m,2))
Problem p02766 (python)

Fixed submission:
import math
N,K = map(int,input().split())
print(int(math.log(N,K)+1))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
print(int(math.log(N,K)+1))
Problem p02831 (python)

Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
print(A*B//gcd(A,B))

Buggy submission (verdict: Runtime Error):
from fractions import math
A,B=map(int,input().split())
print(A*B//math.gcd(A,B))

Buggy submission (verdict: Runtime Error):
from fractions import math
A,B=map(int,input().split())
print(A*B/math.gcd(A,B))
Problem p02833 (python)

Fixed submission:
import fractions


N = int(input())
if N == 0:
  print(0)
elif N % 2 == 1:
  print(0)
else:
  ans = 0
  log = int(fractions.math.log(N//2,5))
  for l in range(1,log+1):
    power = 5**l
    ans += (N//2) // power
  print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
if N % 2 == 1:
  print(0)
else:
  ans = 0
  log = int(fractions.math.log(N//2,5))
  for l in range(1,log+1):
    power = 5**l
    ans += (N//2) // power
  print(ans)
Problem p02881 (python)

Fixed submission:
def make_divisors(n):
    '''
    nの約数の配列を返す
    '''
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def solve():
    N = int(input())
    D = make_divisors(N)
    ans = N - 1
    for d in D:
        ans = min(ans, N // d - 1 + d - 1)
    print(ans)

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
import sympy

def solve():
    N = int(input())
    D = sympy.divisors(N)
    ans = N - 1
    for d in D:
        print(d)
        ans = min(ans, N // d - 1 + d - 1)
    print(ans)

if __name__ == "__main__":
    solve()
Problem p02987 (python)

Fixed submission:
s = input()
s_sorted = ''.join(sorted(s))
if (s_sorted[0]==s_sorted[1]) and (s_sorted[2]==s_sorted[3]) and (s_sorted[1]!=s_sorted[2]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
s_sorted = ''.join(sorted(s))
if s_sorted[0]==s_sorted[1] and s_sorted[2]==s_sorted[3] and S[1]!=S[2]:
  print('Yes')
else:
  print('No')
Problem p03042 (python)

Fixed submission:
S = input()
f,e = int(S[:2]),int(S[2:])
if (f > 12 or f == 0) and 0 < e <= 12:
   print('YYMM')
elif 0 < f <= 12 and (e > 12 or e == 0):
   print('MMYY')
elif 0 < f <= 12 and 0 < e <= 12:
   print('AMBIGUOUS')
else:
    print('NA')

Buggy submission (verdict: Runtime Error):
S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 of e==0 or (f>12 and e>12):
  print('NA')
  exit()
if 1<=f<=12:
  if e>12:
    print('MMYY')
  elif 1<=e<=12
    print('AMBIGUOUS')
elif f>12:
  if 1<=e<=12:
    print('YYMM')

Buggy submission (verdict: Runtime Error):
S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 or e==0 or (f>12 and e>12):
  print('NA')
else:
  if 1<=f<=12 and e>12:
    print('MMYY')
  elif f>12 and 1<=e<=12:
    print('YYMM')
  elif 1<=f<=12, 1<=e<=12
    print('AMBIGUOUS')
Problem p03803 (python)

Fixed submission:
a,b = map(int,input().split())
if a == b:
  ans = 'Draw'
elif a == 1:
  ans = 'Alice'
elif b == 1:
  ans = 'Bob'
elif a > b:
  ans = 'Alice'
else:
  ans = 'Bob'
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input.split())
if a == b:
  ans = 'Draw'
elif a == 1:
  ans = 'Alice'
elif b == 1:
  ans = 'Bob'
elif a > b:
  ans = 'Alice'
else:
  ans = 'Bob'
print(ans)
Problem p02623 (python)

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(m):
    b2.append(b2[i]+b[i])
ans = 0
cnt = m
for i in range(n+1):
    if a2[i] > k:
        break
    sm = 0
    while b2[cnt] > k-a2[i]:
        cnt -= 1
    ans = max(cnt+i, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
ans = 0
for i in range(n):
    if a[i] > k:
        break
    cnt = m
    sm = 0
    while sm < k-a2[i]:
        sm = b2[cnt-1]
        cnt -= 1
    ans = max(cnt, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
for i in range(len(a)):
    if a[0] > k:
        break
    cnt = 0
    sm = 0
    while sm < k-a2[i]:
        sm = b2[cnt]
        cnt += 1
    ans = max(cnt, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
ans = 0
for i in range(len(a)):
    cnt = 0
    sm = 0
    while sm < k-a2[i]:
        sm += b[cnt]
        cnt += 1
    ans = max(cnt, ans)
print(ans)
Problem p02689 (python)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
    ai, bi = map(int, input().split()) 
    if h[ai-1] >= h[bi-1]:
        ans[bi-1] = 0
    if h[ai-1] <= h[bi-1]:
        ans[ai-1] = 0
print(sum(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
    ai, bi = map(int, input().split()) 
    ab[i] = ai
    ab[i+m] = bi
    if h[ai-1] >= h[bi-1]:
        ans[bi-1] = 0
    elif h[ai-1] < h[bi-1]:
        ans[ai-1] = 0
print(sum(ans))
Problem p02711 (python)

Fixed submission:
n = input()
print('Yes' if '7' in n else 'No')

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd(x):
    return reduce(math.gcd, x)


a = int(input())
l = []
for i in range(1, a+1):
    for j in range(1, a+1):
        for k in range(1, a+1):
            l.append(gcd([i, j, k]))
print(sum(l))
Problem p02759 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
    print(int(n/2))
else:
    print(int(n//2+1))

Buggy submission (verdict: Runtime Error):
lst1 = [int() for i in input().split()]
lst2 = [int() for i in input().split()]
lst3 = [int() for i in input().split()]
n = int(input())
b = [int(input()) for i in range(n)]
lst4 = [lst1[0], lst2[0], lst3[0]]
lst5 = [lst1[1], lst2[1], lst3[1]]
lst6 = [lst1[2], lst2[2], lst3[2]]
lst7 = [lst1[0], lst2[1], lst3[2]]
lst8 = [lst1[2], lst2[1], lst3[0]]
if len(set(b) & set(lst4)) == 3:
    print('Yes')
elif len(set(b) & set(lst5)) == 3:
    print('Yes')
elif len(set(b) & set(lst6)) == 3:
    print('Yes')
elif len(set(b) & set(lst7)) == 3:
    print('Yes')
elif len(set(b) & set(lst8)) == 3:
    print('Yes')
else:
    print('No')
Problem p02829 (python)

Fixed submission:
a = [int(input())]
b = [int(input())]
l = [1, 2, 3]
ans = set(l) - set(a) -set(b)
print(list(ans)[0])

Buggy submission (verdict: Runtime Error):
import fraction
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(a, b))
Problem p02831 (python)

Fixed submission:
a, b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b= b, a%b
    return a
def lcm(a, b):
    return (a * b) // gcd(a, b)
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return (a * b) // math.gcd(a, b)
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import fractions
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))
Problem p02847 (python)

Fixed submission:
s = input()
l = [None, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))

Buggy submission (verdict: Runtime Error):
s = input()
l = [None, 'SAT', 'FRY', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))
Problem p02596 (python)

Fixed submission:
#!/usr/bin/env python3
# 整数の入力
k = int(input())

x = 7%k
for i in range(1, k+1):
    if x == 0:
        print(i)
        exit(0)
    x=(10*x+7)%k

print(-1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# 整数の入力
k = int(input())

if k % 2 == 0:
    print(-1)
    #print("a")
    exit(0)

d1 = k % 10
print(d1)
if d1 != 1 and d1 != 7 and d1 != 3 and d1 != 9:
    print(-1)
    #print("b")
    exit(0)

def PrimeJudge(n):
    ret = True
    for i in range(2, int(n ** 0.5)+1):
        if n % i == 0:
            ret = False
            break
    return ret

if PrimeJudge(k) == False:
    print(-1)
    #print("c")
    exit(0)

s = 7
while(1):
    i = int(s)
    if i < k:
        s = str(s)+'7'
    else:
        if i % k == 0:
            print(len(s))
            exit(0)
        else:
            s = str(s)+'7'
Problem p02623 (python)

Fixed submission:
import numpy as np
n,m,k = list(map(int, input().split()))
a_list = np.array(input().split()).astype(int)
b_list = np.array(input().split()).astype(int)
a_sum =[0]
b_sum=[0]
for i in range(n):
    a_sum.append(a_sum[-1]+ a_list[i])
for i in range(m):
    b_sum.append(b_sum[-1] + b_list[i])
#print(a_sum, b_sum)
total = 0
num = m

for i in range(n+1):
    
    if a_sum[i] > k:
        break
    while (k - a_sum[i]) < b_sum[num]:
        num -=1
        #print(i, num)
        if num == -1:
            break
    total = max(i+num, total)
    
    
print(total)

Buggy submission (verdict: Runtime Error):
n,m,k = list(map(int, input().split()))
a_list = np.array(input().split()).astype(int)
b_list = np.array(input().split()).astype(int)
ans_list=[]
for i in range(n):
    for l in range(m):
        if sum(a_list[:i]) + sum(b_list[:l]) <= k:
            ans_list.append(i+l)
            
ans_list.sort()
print(ans_list[-1])

Buggy submission (verdict: Runtime Error):
n, m,k = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
count = 0
for i in range(n + m):
    #print(k)
    if a_list[0] >= b_list[0] and len(a_list) >= 1:
        k -= a_list.pop(0)
    else:
        k -= b_list.pop(0)
        
    if k > 0:
        count += 1
    else:
        break
        
print(count+1)

Buggy submission (verdict: Runtime Error):
n, m,k = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
count = 0
for i in range(n + m):
    print(k)
    if a_list[0] >= b_list[0] and len(a_list) >= 1:
        k -= a_list.pop(0)
    else:
        k -= b_list.pop(0)
        
    if k > 0:
        count += 1
    else:
        break
        
print(count+1)
Problem p02723 (python)

Fixed submission:

S = str(input())
a= 'Yes'
b='No'
if S[3] is S[2] and S[4] is S[5]:
    print(a)
else:
    print(b)

Buggy submission (verdict: Runtime Error):
S=str(input())
if S[3]　== S[2]:
  if S[4]==S[6]:
    return str(Yes)
Problem p02729 (python)

Fixed submission:
inp=str(input())
N= int(inp.split()[0])
M=int(inp.split()[1])
n= abs(N)
m=abs(M)
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Buggy submission (verdict: Runtime Error):
N=int(input())
M=int(input())

print(int((M-1)*M/2+(N-1)*N/2))

Buggy submission (verdict: Runtime Error):
N=int(input())
M=int(input())
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Buggy submission (verdict: Runtime Error):
N=int(input())
M=int(input())
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))
Problem p02829 (python)

Fixed submission:
a_list=[1,2,3]
p= input()
q=input()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])

Buggy submission (verdict: Runtime Error):
a_list=[1,2,3]
p,q= input().split()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])
Problem p02881 (python)

Fixed submission:
#nの約数を列挙する関数
import math
def n_div(n):
    div_list = []
    import math
    for i in range(1, math.ceil(math.sqrt(n))+1):
        if n % i ==0:
            div_list.append(i)
            if i*i ==n:
                continue
            div_list.append(n//i)
    div_list.sort()
    return div_list

n = int(input())
lr = n_div(n)
#print(lr)
if len(lr) % 2==0:
    a = len(lr)/2
    a = int(a)
    ans = lr[a]+lr[a-1]-2
else:
    a = math.floor(len(lr)/2)
    #print(a)
    ans = lr[a]*2  -2
    
print(ans)

Buggy submission (verdict: Runtime Error):
#nの約数を列挙する関数
def n_div(n):
    div_list = []
    import math
    for i in range(1, math.ceil(math.sqrt(n))+1):
        if n % i ==0:
            div_list.append(i)
            if i*i ==n:
                continue
            div_list.append(n//i)
    div_list.sort()
    return div_list

n = int(input())
lr = n_div(n)
#print(lr)
if len(lr) % 2==0:
    a = len(lr)/2
    a = int(a)
    ans = lr[a]+lr[a-1]-2
else:
    a = math.floor(len(lr)/2)
    #print(a)
    ans = lr[a]*2  -2
    
print(ans)

Buggy submission (verdict: Runtime Error):
#nの約数を列挙する関数
def n_div(n):
    div_list = []
    import math
    for i in range(1, math.ceil(math.sqrt(n))+1):
        if n % i ==0:
            div_list.append(i)
            if i*i ==n:
                continue
            div_list.append(n//i)
    div_list.sort()
    return div_list

n = int(input())
lr = n_div(n)
#print(lr)
if len(lr) % 2==0:
    a = len(lr)/2
    a = int(a)
    ans = lr[a]+lr[a-1]-2
else:
    a = math.floor(len(lr))
    ans = lr[a]**2
    
print(ans)
Problem p03127 (python)

Fixed submission:
import math
n= int(input())
a_list = list(map(int, input().split()))
gcd = a_list[0]
for i in range(1,n):
    gcd = math.gcd(gcd,a_list[i])
    
    
print(gcd)

Buggy submission (verdict: Runtime Error):
n= int(input())
a_list = list(map(int, input().split()))
gcd = a_list[0]
for i in range(1,n):
    gcd = math.gcd(gcd,a_list[i])
    
    
print(gcd)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
import math
def dfs(lis, i):
    if i == 0:
        return lis[0]
    if i >0:
        ans = math.gcd(dfs(lis,i-1),lis[i])
        return ans
print(dfs(a_list,n-1))
Problem p02726 (python)

Fixed submission:
from collections import deque
N,X,Y=map(int,input().split())

count=[0]*N

def bfs(start):
    dist=[-1]*(N+1)#indexと頂点の番号を合わせる
    q=deque()
    q.append([start,0])
    dist[start]=0
    while q:
        j,kyori=q.popleft()

        if j-1>=1:
            if dist[j-1]==-1:
                q.append([j-1,kyori+1])
                dist[j-1]=kyori+1

        if j+1<=N:
            if dist[j+1]==-1:
                q.append([j+1,kyori+1])
                dist[j+1]=kyori+1
        
        if j == X and dist[Y]==-1:
            q.append([Y,kyori+1])
            dist[Y]=kyori+1

        if j == Y and dist[X]==-1:
            q.append([X,kyori+1])
            dist[X]=kyori+1

    return dist[1:]

def main():
    for start in range(1,N+1):
        dist=bfs(start)
        for d in dist:
            count[d]+=1

    for i in count[1:]:
        print(i//2)

main()

Buggy submission (verdict: Runtime Error):
from collections import deque
N,X,Y=map(int,input().split())

count=[0]*N

def bfs(start):
    dist=[-1]*(N+1)#indexと頂点の番号を合わせる
    q=deque()
    q.append([start,0])
    dist[start]=0
    while not q.empty():
        j,kyori=q.popleft()

        if j-1>=1:
            if dist[j-1]==-1:
                q.append([j-1,kyori+1])
                dist[j-1]=kyori+1

        if j+1<=N:
            if dist[j+1]==-1:
                q.append([j+1,kyori+1])
                dist[j+1]=kyori+1
        
        if j == X and dist[Y]==-1:
            q.append([Y,kyori+1])
            dist[Y]=kyori+1

        if j == Y and dist[X]==-1:
            q.append([X,kyori+1])
            dist[X]=kyori+1

    return dist[1:]

def main():
    for start in range(1,N+1):
        dist=bfs(start)
        for d in dist:
            count[d]+=1

    for i in count[1:]:
        print(i//2)

main()
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
N=input()
S=list(input())
 
if len(N)%2!=0:
  print('No')
else:
  if S[:N/2]==S[N/2:]:
    print('Yes')
  else:
    print('No')
Problem p02860 (python)

Fixed submission:
N=int(input())
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N//2]==S[N//2:]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
N=input()
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N/2]==S[N/2:]:
        print('Yes')
    else:
        print('No')

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

if len(N)%2!=0:
  print('No')
else:
  if S[:N/2]==S[N/2]:
    print('Yes')
  else:
    print('No')