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

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

con = 0
ans = list(int() for _ in range(100000))
pre = 0


for _ in range(K):

    D = int(input())
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)

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

con = 0
ans = list(int() for _ in range(100))
pre = 0


for _ in range(K):

    D = int(input())
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)
Problem p02729 (python)

Fixed submission:
from math import *


N,M = list(map(int,input().split(" ")))
A = (N*(N-1))/2+(M*(M-1))/2
print (int(A))

Buggy submission (verdict: Runtime Error):
L= int(input())
A = (L/3)*(L/3)*(L/3)
print (A)

Buggy submission (verdict: Runtime Error):
N = input()
M = input()
A = (factorial(N)*factorial(N-1))+(factorial(M)*factorial(M-1))/2
print A
Problem p02659 (python)

Fixed submission:
from decimal import Decimal

A,B=input().split()
B=Decimal(B)
A=int(A)
ans=int(A*B)
 
print(ans)

Buggy submission (verdict: Runtime Error):
A,B=input().split()
B=Decimal(B)
A=int(A)
ans=int(A*B)
 
print(ans)
Problem p02754 (python)

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

if N%(A+B)==0:
    print(N//(A+B)*A)

else:
    rem=min(N%(A+B),A)
    print(N//(A+B)*A+rem)

Buggy submission (verdict: Runtime Error):
a=0
for i in range(10^100):
  N, A, B=list(map(int, input().split()))
  if A+B==N:
    a=a+A
  else:
    a=a+A+N-(A+B)
  
    
print(a)
Problem p02759 (python)

Fixed submission:
N=int(input())

if N%2==0:
    print(int(N/2))

elif N%2==1:
    print(int(int(N/2)+1))

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

if N%2==0:
    print(N/2)

elif N%2==1:
    print(int(N/2)+1)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
replaces = 0
for ch in range(len(S)):
    if S[ch] != T[ch]:
        replaces += 1

print(replaces)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
    if S[ch] == T[ch]:
        replaces += 1

print(replaces)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
    if S[ch] == T[ch]:
    replaces += 1

print(replaces)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
  if S[ch] == T[ch]:
    replaces += 1

print(replaces)
Problem p03307 (python)

Fixed submission:
import math

n = int(input())
asn = 0

if n % 2 == 0: ans = n
else: ans = 2*n

print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())

print(2*n//math.gcd(2,n)) #最小公倍数

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n//math.gcd(2,n)) #最小公倍数
Problem p02835 (python)

Fixed submission:
array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
array = map(int, input().split())
print(f'{ "bust" if sum(array) >= 22 else "win"}')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f'string value: { "bust" if a+b+c >= 22 else "win"}')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f'string value: { "bust" if a+b+c >= 22 else "win"}')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input().split())
# 出力
print("{}".format(x = "bust" if n >= 22 else "win"))
Problem p02627 (python)

Fixed submission:
alpha = input()
if alpha.isupper() == True:
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
alpga = input()
if alpha == isupper():
  print('A')
else:
  print('a')
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ta = 0
aok = 0
while True:
    ta = c-b
    c = ta
    if c <=0:
        print("Yes")
        break
    aok = a - d
    a = aok
    if a <=0:
        print("No")
        break
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())

if W >= S:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

check = True
while True:
    if check:
        c -= b
        if c <= 0:
            print("Yes")
            break

else:
    a -= d
    if a<= 0:
        print("No")
        break

    check = not check

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

if W >= S:
    print("unsafe")
else:
    print("safe")
Problem p02711 (python)

Fixed submission:
S = input()
if "7" in S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = int(input())
if "7" in S:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
N = input()
if "7" in S:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
S = input()
if 7 in S:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
N = input()
if 7 in N:
    print("yes")
else:
    print("no")
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

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

Buggy submission (verdict: Runtime Error):
S = input()
if s[3] == s[4] and s[5] == s[6]:
    print(Yes)
else:
    print(No)
Problem p02729 (python)

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

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

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

n = N-1
m = M-1

Even = N*n
Odd = M*m

print((Even+Odd)/2)

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

n = N-1
m = M-1

if N == 1 and M == 1:
    print("0")
else:
    print((N*n+M*m)/2)

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

n = N-1
m = M-1

if N == 1 and M == 1:
    print("0")
else:
    print(N*n+M*m)
Problem p02777 (python)

Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if U == S: A-=1
else: B-=1
print(A,B)

Buggy submission (verdict: Runtime Error):
S,T = input().split()
A,B = map(int, input().split())
U = input()

if U = S: A-=1
else: B-=1
print(A,B)

Buggy submission (verdict: Runtime Error):
S,T = map(str, input().split())
A,B = map(int, input().split())
U = input()

if U = S:
    print({}""{},(A-1)+B)
else:
    print({}""{},A+(B-1))
Problem p02627 (python)

Fixed submission:
a = input()
if a.islower():
    print('a')
else:
    print('A')

Buggy submission (verdict: Runtime Error):
literal = ('a', 'b', 'c', 'd', 'e', 'f', 
           'g', 'h', 'i', 'j', 'k', 'l', 
           'm', 'n', 'o', 'p', 'q', 'r', 
           's', 't', 'u', 'v', 'w', 'x', 
           'y', 'z')
x = int(input())
str2 = ''
str3 = ''
q = x
if x < 27:
    str3 = literal[x-1]
while q > 26:
    q, mod = divmod(x, 26)
    str1 = ''
    if q > 26:
        x = q
        str1 = literal[mod - 1]
        str3 = str1 + str2
        str2 = str3
        str3 = ''
    else:
        str1 += literal[q - 1]
        str1 += literal[mod - 1]
        str3 = str1 + str2
print(str3)

Buggy submission (verdict: Runtime Error):
literal = ('a', 'b', 'c', 'd', 'e', 'f', 
           'g', 'h', 'i', 'j', 'k', 'l', 
           'm', 'n', 'o', 'p', 'q', 'r', 
           's', 't', 'u', 'v', 'w', 'x', 
           'y', 'z')
x = int(input())
str2 = ''
str3 = ''
q = x
while q > 26:
    q, mod = divmod(x, 26)
    str1 = ''
    if q > 26:
        x = q
        str1 = literal[mod - 1]
        str3 = str1 + str2
        str2 = str3
        str3 = ''
    else:
        str1 += literal[q - 1]
        str1 += literal[mod - 1]
        str3 = str1 + str2
print(str3)

Buggy submission (verdict: Runtime Error):
literal = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
           'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
x = int(input())
str2 = ''
str3 = ''
q = x
while q > 26:
    q, mod = divmod(x, 26)
    str1 = ''
    if q > 26:
        x = q
        str1 = literal[mod - 1]
        str3 = str1 + str2
        str2 = str3
        str3 = ''
    else:
        str1 += literal[q - 1]
        str1 += literal[mod - 1]
        str3 = str1 + str2
print(str3)

Buggy submission (verdict: Runtime Error):
literal = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
           'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
x = int(input())
str2 = ''
str3 = ''
q = x
while q > 26:
    q, mod = divmod(x, 26)
    str1 = ''
    if q > 26:
        x = q
        str1 = literal[mod - 1]
        str3 = str1 + str2
        str2 = str3
        str3 = ''
    else:
        str1 += literal[q - 1]
        str1 += literal[mod - 1]
        str3 = str1 + str2
print(str3)
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
s3 =[]

s = list(input())

s1 = s


s2= s1[K-1]

s3 = s2.lower()

s1[K-1] = s3

print('' .join(s1))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s3 =[]

s = list(input())

s1 = s


s2= s1[K]

s3 = s2.lower()

s1[K] = s3

print('' .join(s1))
Problem p02682 (python)

Fixed submission:
a, b, c, d = list(map(int, input().split()))
if a >= d:
  print(d)
elif a+b>=d:
  print(a)
else:
  print(2*a+b-d)

Buggy submission (verdict: Runtime Error):
a, b, c, d = list(map(int, input().split()))
if a >= d:
  print(d)
elif a+b>=d:
  print(a)
elif:
  print(2*a+b-d)
Problem p02693 (python)

Fixed submission:
a = int(input())
b, c = list(map(int, input().split()))
flag = 0
for i in range(b, c+1):
  if i % a == 0:
    flag = 1
if flag:
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
a = int(input())
b, c = list(map(int, input().split()))
if 
if int(c/a)>int(b/a):
  print("OK")
else:
  if b % a == 0:
    print("OK")
  else:
    print("NG")
Problem p02701 (python)

Fixed submission:
N = int(input())
A = []
for _ in range(N):
  A.append(input())
B = list(set(A))
print(len(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for _ in range(N):
  A.appen(input())
B = list(set(A))
print(len(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
ans = 0
for _ in range(N):
  B = input()
  if not B in A:
    ans += 1
    A.append(input())
print(ans)
Problem p02707 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
for i in range(N-1):
  ans[A[i]-1] += 1
for j in range(N):
  print(ans[j])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
for i in range(N):
  ans[A[i]-1] += 1
for j in range(N):
  print(ans[j])
Problem p02725 (python)

Fixed submission:
K, N = list(map(int, input().split()))
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += [K-L[N-1]+L[0]]
ans = K-max(sa)
print(ans)

Buggy submission (verdict: Runtime Error):
K, N = map(int, input().split())
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += K-L[N-1]+L[0]
ans = K-max(sa)
print(ans)
Problem p02773 (python)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
D = max(C)
for s in sorted([B[i] for i, x in enumerate(C) if x == D]):
　print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
#ここでなんかいもよびだしている
D = max(C)
for s in sorted([B[i] for i, x in enumerate(C) if x == D]:
    print(s)
Problem p02832 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(N):
  if A[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(1,N+1):
  if A[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
num = 1
for i in range(N:
  if a[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(1,N+1):
  if a[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
for i in range(1:N+1):
  if i in A:
    x = A[x+1:].index(i)
    count += 1
  else:
    break
if count != 0:
  print(count)
else:
  print(-1)
Problem p02989 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)-1]
b = A[int(N/2)]
print(b-a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(n/2)+1]
print(b-a)
Problem p03345 (python)

Fixed submission:
A, B, C, K = map(int,input().split())
print(A-B if K % 2 == 0 else B-A)

Buggy submission (verdict: Runtime Error):
A, B, C, K = int(input().split())
print(A-B if K % 2 == 0 else B-A)
Problem p03805 (python)

Fixed submission:
N, M = map(int, input().split())
pathmat=[[0]*N for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    pathmat[a-1][b-1] = 1
    pathmat[b-1][a-1] = 1

visited =  [False]*N
visited[0] = True


def DFS(now, visited):
    if all(visited):
        return 1
    ans = 0
    for i in range(N):
        if not pathmat[now][i]:
            continue
        if visited[i]:
            continue
        visited[i]=True
        ans += DFS(i, visited)
        visited[i]=False
    return ans

print(DFS(0,visited))

Buggy submission (verdict: Runtime Error):
def DFS(now, visited):
    ans = 0
    if all(visited):
        return 1
    for i in range(N):
        if path[now][i] and visited[i] == False:
            visited[i] = True
            ans += DFS(i, visited)
            visited[i] = False
    return ans
    


N, M = map(int, input().split())
path = [[0]*N for i in range(M)]
for i in range(M):
    a, b = map(int, input().split())
    path[a-1][b-1] = 1
    path[b-1][a-1] = 1
visited = [False]*N
visited[0] = True
print(DFS(0, visited))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
pathmat=[[0]*N for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    pathmat[a-1][b-1] = 1
    pathmat[b-1][a-1] = 1

visited =  [False]*N
visited[0] = True
ans = 0

def DFS(now, visited):
    if all(visited):
        return 1
    for i in range(N):
        if not pathmat[now][i]:
            continue
        if visited[i]:
            continue
        visited[i]=True
        ans += DFS(i, visited)
        visited[i]=False
    return ans

print(DFS(0,visited))
Problem p02659 (python)

Fixed submission:
import math

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

# A *= 100
# B = float(B)
# B = math.floor(B * 100)
B = B.replace('.', '').ljust(3, '0')
B = int(B)

# AB = A * B / 100
# floored = int(math.floor(AB))
# print(floored)

AB = A * B
AB = str(AB)
AB = AB[0:-2]
AB = 0 if AB == '' else AB
print(AB)

Buggy submission (verdict: Runtime Error):
import math

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

# A *= 100
B = float(B)
B = math.floor( * 100)

AB = A * B / 100
floored = int(math.floor(AB))
print(floored)

# AB = A * B
# AB = str(AB)
# AB = AB[0:-2]
# AB = 0 if AB == '' else AB
# print(AB)

Buggy submission (verdict: Runtime Error):
import math

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

# A *= 100
B = math.floor(B * 100)

AB = A * B / 100
floored = int(math.floor(AB))
print(floored)

# AB = A * B
# AB = str(AB)
# AB = AB[0:-2]
# AB = 0 if AB == '' else AB
# print(AB)

Buggy submission (verdict: Runtime Error):
import math

A, B = list(input().split())
A = int(A)
B = '{:.2f}'.format(B).replace('.', '')
B = int(B)

# A *= 100
# B = int(B * 100)


AB = A * B / 100
floored = int(math.floor(AB))
print(floored)

# AB = A * B
# AB = str(AB)
# AB = AB[0:-2]
# AB = 0 if AB == '' else AB
# print(AB)

Buggy submission (verdict: Runtime Error):
import math

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

multipled = A * B
floored = math.floor(multipled)

print(floored)
Problem p02729 (python)

Fixed submission:
from math import factorial

inputted = list(map(int, input().split()))
N = inputted[0]
M = inputted[1]

nPk = lambda n, k: 0 if n - k < 0 else factorial(n) / (factorial(k) * factorial(n - k))

answer = nPk(N, 2) +  nPk(M, 2)
answer = int(answer)

print(answer)

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

inputted = list(map(int, input().split()))
N = inputted[0]
M = inputted[1]

nPk = lambda n, k: factorial(n) / (factorial(k) * factorial(n - k))

answer = nPk(N, 2) +  nPk(M, 2)
answer = int(answer)

print(answer)
Problem p02777 (python)

Fixed submission:
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = "{} {}".format(A2, B2)

print(output)

Buggy submission (verdict: Runtime Error):
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = A2 + ' ' + B2

print(output)
Problem p02779 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

table = {}
answer = 'YES'
for i in range(0, len(A)):
    Ai = A[i]
    count = table.get(Ai) + 1 if table.get(Ai) else 1
    table[Ai] = count

    if table.get(Ai) >= 2:
        answer = 'NO'
        break

print(answer)

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

table = {}
answer = 'Yes'
for i in range(0, len(A) + 1):
# for(let i = 0; i < A.length; i++):
    Ai = A[i]
    count = table.get(Ai) + 1 if table.get(Ai) else 1
    table[Ai] = count

    if table.get(Ai) >= 2:
        answer = 'No'
        break

print(answer)
Problem p02933 (python)

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

answer = s if a >= 3200 else 'red'

print(answer)

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

answer = s if a >= 3200 else 'red'

print(answer)
Problem p02970 (python)

Fixed submission:
import math

inputted = list(map(int, input().split()))
N = inputted[0]
D = inputted[1]

monitor = D * 2 + 1
answer = math.ceil(N / monitor)

print(answer)

Buggy submission (verdict: Runtime Error):
import math

inputted = list(map(int, input()))
N = inputted[0]
D = inputted[1]

monitor = (D + 1) * 2
answer = math.ceil(N / monitor)

print(answer)
Problem p02989 (python)

Fixed submission:
N = int(input())
d = list(map(int, input().split()))

same = N / 2

# d.sort()

# distribution = [0] * d[len(d) - 1]
# total = 0
# for di in d:
#     num = d.count(di)
#     distribution[di - 1] = num

table = {}
for di in d:
    table[di] = 1 if table.get(di) is None else table.get(di) + 1
table = sorted(table.items())

total = 0
start = 0
end = 0
for difficulty, num in table:
    total += num

    if start == 0 and total == same:
        start = difficulty
    elif start != 0:
        end = difficulty
        break

# print(table, start, end)

answer = end - start
print(answer)

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

same = N / 2

# d.sort()

# distribution = [0] * d[len(d) - 1]
# total = 0
# for di in d:
#     num = d.count(di)
#     distribution[di - 1] = num

table = {}
for di in d:
    table[di] = 0 if table[di] is None else table[di] + 1

# total = 0
# totals = [0] * d[len(d) - 1]
# num = 0
# for i in range(len(distribution)):
#     total += distribution[i]
#     totals[i] = total

#     if totals[i] == same:
#         num += 1
#     elif num >= 1:
#         break

print(1)

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

same = N / 2

# d.sort()

# distribution = [0] * d[len(d) - 1]
# total = 0
# for di in d:
#     num = d.count(di)
#     distribution[di - 1] = num

table = {}
for di in d:
    table[di] = 0 if table[di] is None else table[di] += 1

# total = 0
# totals = [0] * d[len(d) - 1]
# num = 0
# for i in range(len(distribution)):
#     total += distribution[i]
#     totals[i] = total

#     if totals[i] == same:
#         num += 1
#     elif num >= 1:
#         break

print(1)
Problem p03011 (python)

Fixed submission:
inputted = list(map(int, input().split()))
AB = BA = inputted[0]
BC = CB = inputted[1]
AC = CA = inputted[2]

answer = min([
    AB + BC,
    AC + CB,
    BA + AC,
    BC + CA,
    CA + AB,
    CB + BA,
])

print(answer)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
W = list(map(int, input().split()))


def search(start, end, i, W):
    S1 = sum(W[0:i + 1])
    S2 = sum(W[i + 1:len(W)])

    next_i = math.floor(i / 2) if S1 >= S2 else math.floor((i + end) / 2)

    if S1 == S2: return i
    if S1 > S2:
        next_start = start
        next_end = i
    else:
        next_start = i + 1
        next_end = end
    
    # print(start, next_start, end, next_end, i, next_i, S1, S2)
    if next_start == end: return next_start
    if next_end == start: return next_end
    
    return search(next_start, next_end, next_i, W)


i = search(0, len(W) - 1, math.floor((len(W) - 1) / 2), W)

S1 = sum(W[0:i + 1])
S2 = sum(W[i + 1:len(W)])
diff = abs(S2 - S1)

print(diff)
Problem p03107 (python)

Fixed submission:
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0 and len(S) >= 2:
    if i >= len(S) - 1:
        i -= 1
        continue

    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)

Buggy submission (verdict: Runtime Error):
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0 and len(S) >= 2:
    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)

Buggy submission (verdict: Runtime Error):
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0:
    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)
Problem p02831 (python)

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

def gcd(a,b):
    while b!=0:
        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):
import math

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

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

print(lcm(A, B))