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

Fixed submission:
def d():
    N = int(input())
    a = {}
    count = 0

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        a[l, r] = a.get((l, r), 0) + 1

    # print(a)

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        # print('a.get(({0}, {1}), 0) * a.get(({1}, {0}), 0) = {2}'.format(l, r, a.get((l, r), 0) * a.get((r, l), 0)))
        count += a.get((r, l), 0)

    print(count)


##########
d()

Buggy submission (verdict: Runtime Error):
def d():
    N = int(input())
    a = {}
    count = 0

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        a[l, r] = a.get((l, r), 0) + 1

    # print(a)

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        # print('a.get(({0}, {1}), 0) * a.get(({1}, {0}), 0) = {2}'.format(l,
                                                                         r, a.get((l, r), 0) * a.get((r, l), 0)))
        count += a.get((r, l), 0)

    print(count)


##########
d()
Problem p02659 (python)

Fixed submission:
from decimal import *
a,b=map(str,input().split())
b = Decimal(b)
a = Decimal(a)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
from decimal import *
a,b=map(str,input().split())
b = Decimal(b)
a = Decimal(a)
print(int(a*b))
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())
ans=(a*b)//gcd(a,b)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a,b=map(int,input().split())
print(lcm(a, b))
Problem p03077 (python)

Fixed submission:
import math

n=int(input())
a=[int(input()) for i in range(5)]

print(4+math.ceil(n/min(a)))

Buggy submission (verdict: Runtime Error):
import math

n=int(input())
a=[int(input()) for i in range(n)]

print(4+math.ceil(n/min(a)))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[int(input()) for i in range(n)]
w=math.ceil(n/min(a))
print(w+4)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[int(input()) for i in range(n)]
m=min(a)
w=math.ceil(n/m)
print(w+4)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[int(input()) for i in range(n)]
m=min(a)
w=math.ceil(n/m)
print(w+4)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[int(input()) for i in range(n)]
m=min(a)
w=math.ceil(n/m)
print(w+4)
Problem p03127 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
def gcdl(numbers):
    return reduce(gcd, numbers)
n=int(input())
a=list(map(int,input().split()))
print(gcdl(a))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcdl(numbers):
    return reduce(math.gcd, numbers)
n=int(input())
a=list(map(int,input().split()))
print(gcdl(a))
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
import math

A, B = input().split()

B = Decimal(B)
A = int(A)
product = A*B

print(math.floor(product))

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

A, B = input().split()

B = decimal(B)
A = int(A)
product = A*B

print(math.floor(product))
Problem p02779 (python)

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

A=sorted(A)

for i in range(0,N):
  if len(A) > i+1:
    if A[i] == A[i+1]:
      print("NO")
      exit(0)
print("YES")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=input().split()
 
for i in range(N)
  if A.count(A[i]) >1:
    print("NO")
    exit(0)
print("YES")
Problem p02790 (python)

Fixed submission:
a,b=input().split(" ")
a=int(a)
b=int(b)
 
a_str=""
b_str=""
for i in range(a):
  b_str=b_str+str(b)
for i in range(b):
  a_str=a_str+str(a)
if int(a_str[0]) > int(b_str[0]):
  print(b_str)
elif int(a_str[0]) < int(b_str[0]):
  print(a_str)
else:
  print(a_str)

Buggy submission (verdict: Runtime Error):
a,b=input().split(" ")
a=int(a)
b=int(b)

a_str=""
b_str=""
for i in range(a):
  b=b+str(b)
for i in range(b):
  a=a+str(a)
if int(a_str) > int(b_str):
  print(b_str)
elif int(a_str) < int(b_str):
  print(a_str)
else:
  print(a_str)
Problem p02915 (python)

Fixed submission:
a=input()
a=int(a)
b=a*a*a
print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=a*a*a
print(b)
Problem p02836 (python)

Fixed submission:
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)
Problem p02729 (python)

Fixed submission:
n,m = map(float, input().split())
print(int((n*(n-1)+m*(m-1))/2))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
print((n*(n-1)/2+m*(m-1)/2)
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if s[0]==s[1] and S[0]==s[2]:
  print('No')
else:
  print('Yes')
Problem p02777 (python)

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

if u == w[0]:
  print(n[0]-1,n[1])
else:
  print(n[0],n[1]-1)

Buggy submission (verdict: Runtime Error):
w = list(map(input().split()))
n = list(map(int, input().split()))
u = input()

if u == w[0]:
  print(n[0]-1,n[1])
else:
  print(n[0],n[1]-1)
Problem p02829 (python)

Fixed submission:
ans = [1,2,3]
a = int(input())
b = int(input())
ans.remove(a)
ans.remove(b)

print(ans[0])

Buggy submission (verdict: Runtime Error):
ans = [1,2,3]
remove(int(input()))
remove(int(input()))

print(ans)
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
d = n//(a+b)
e = 0
if n%(a+b) <= a:
  e += n%(a+b)
else:
  e += a
print(d*a+e)

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

s = "b"*a + "r"*b
d = n//(a+b)+1
s = s*d
print(s[:n].count("b"))

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

s = "b"*a + "r"*b
s = s*(10**8)
print(s[:n].count("b"))
Problem p02836 (python)

Fixed submission:
s = input()
c = 0
if len(s)%2==0:
  for a,b in zip(s[len(s)//2:],reversed(s[:len(s)//2])):
    if a != b:
      c+=1
else:
  for a,b in zip(s[len(s)//2+1:],reversed(s[:len(s)//2])):
    if a != b:
      c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
s, t = map(str,input().split())
ans = ""
for i, j in zip(s,t):
  ans += i
  ans += j
print(ans)
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a < b+c:
	print(abs(a-(b+c)))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input())
print(abs(a-b+c))
Problem p03242 (python)

Fixed submission:
w = input()
c = ""
for i in w:
  if i == "9":
    i = "1"
    c += i
  elif i == "1":
    i = "9"
    c += i
print(c)

Buggy submission (verdict: Runtime Error):
w = input()
c = ""
for i in w:
  if i == "9":
    i = 1
    c += i
  elif i == "1":
    i == 9
    c += i
  else:
    c += i
print(c)

Buggy submission (verdict: Runtime Error):
w = input()
c = ""
for i in w:
  if i == "9":
    i = 1
    c += i
  elif i == "1":
    i == 9
    c += i
  else:
    c += i
print(i)
Problem p03775 (python)

Fixed submission:
N = int(input())
ans = 1
for i in range(1,N):
  if N % i == 0:
    ans = max(len(str(i)), len(str(N//i)))
  if N//i and i > N//i:
    break
print(ans)

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

for i in range(1,N):
  if N % i == 0:
    ans = max(len(str(i)), len(str(N//i)))
  if N//i and i > N//i:
    break
print(ans)
Problem p03805 (python)

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

#無向行列
path_matrix = []

#無向行列の初期化
for _ in range(N):
    path_matrix.append([False] * N)

for _ in range(M):
  line = map(int, input().split())
  paths = [x-1 for x in line]
  path_matrix[paths[0]][paths[1]] = True
  path_matrix[paths[1]][paths[0]] = True
  
visited = [False]*N

def dfs(now, depth):
  if visited[now]:
    return 0
  if depth == N-1:
    return 1
  
  visited[now] = True
  total_paths = 0
  for i in range(N):
    if path_matrix[now][i]:
      total_paths += dfs(i, depth+1)
  
  visited[now] = False
  
  return total_paths
print(dfs(0,0))

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

#無向行列
path_matrix = [[False]*N for _ in range(M)]

for _ in range(M):
  line = map(int, input().split())
  paths = [x-1 for x in line]
  path_matrix[paths[0]][paths[1]] = True
  path_matrix[paths[1]][paths[0]] = True
  
visited = [False]*N

def dfs(now, depth):
  if visited[now]:
    return 0
  if depth == N-1:
    return 1
  
  visited[now] = True
  total_paths = 0
  for i in range(N):
    if path_matrix[now][i]:
      total_paths += dfs(i, depth+1)
  
  visited[now] = False
  
  return total_paths
print(dfs(0,0))

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

#無向行列
path_matrix = [[False]*N for _ in range(M)]

for _ in range(M):
  line = map(int, input().split())
  paths = [x-1 for x in line]
  path_matrix[paths[0]][paths[1]] = True
  path_matrix[paths[1]][paths[0]] = True
  
visited = [False]*N

def dfs(now, depth):
  if visited[now]:
    return 0
  if depth == N-1:
    return 1
  
  visited[now] = True
  total_paths = 0
  for i in range(N):
    if path_matrix[now][i]:
      total_paths += dfs(i, depth+1)
  
  visited[now] = False
  
  return total_paths
print(dfs(0,0))
Problem p02762 (python)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parent = list(range(n+1))
        self.size = [1] * (n+1)
        
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, a, b):
        a = self.find(a)
        b = self.find(b)
        
        if self.parent[a] == self.parent[b]:
            return
        if self.size[a] >= self.size[b]:
            self.parent[b] = a
            self.size[a] += self.size[b]
        else:
            self.parent[a] = b
            self.size[b] += self.size[a]
        
    def count(self, x):        
        return self.size[self.find(x)]

n, m, k = map(int, input().split())

uf = UnionFind(n)
ans = [0] * (n + 1)

for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)
    ans[a] -= 1
    ans[b] -= 1
    
for _ in range(k):
    a, b = map(int, input().split())
    if uf.find(a) == uf.find(b):
        ans[a] -= 1
        ans[b] -= 1
        
for i in range(1, n+1):
    ans[i] += uf.count(i) - 1    
    
print(" ".join(map(str, ans[1:])))

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
f = {}
for _ in range(m):
    a, aa = map(int, input().split())
    try:
        f[a].append(aa)
    except:
        f[a] = [aa]
    try:
        f[aa].append(a)
    except:
        f[aa] = [a]
b = {}
for _ in range(k):
    a, aa = map(int, input().split())
    try:
        b[a].append(aa)
    except:
        b[a] = [aa]
    try:
        b[aa].append(a)
    except:
        b[aa] = [a]
    

g = []
done_g = []

for now in range(1, n+1):
    if now in done_g:
        continue
    done = []
    stack = [now]
    while len(stack) != 0:
        now = stack.pop()
        if now in done:
            continue
        done.append(now)
        stack += f[now]
    
    g.append(done)
    done_g += done

ans = {}
for gg in g:
    for x in gg:
        base = len(gg) - 1
        if x in f.keys():
            base -= len(set(gg).intersection(set(f[x])))
        if x in b.keys():
            base -= len(set(gg).intersection(set(b[x])))
        ans[x] = base

anss = []
for k in range(n):
    anss.append(str(ans[k+1]))
print(" ".join(anss))
Problem p03250 (python)

Fixed submission:
import numpy as np

a = list(map(int,input().split()))
print(np.max(a) * 9 + np.sum(a))

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

print(np.max(a) * 9 + np.sum(a))
Problem p03326 (python)

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

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.vstack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

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

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.stack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

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

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.stack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int, input().split())

if k < a:
    print(k)
elif a <=k  and k <= a+b:
    print(a)
elif a + b < k and k <= a  + b + c:
    print(a-k+a+b)

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

la = [1]*a
lb = [0]*b
lc = [-1]*c
m = 0
l = la + lb + lc 

for i in range(k):
    m = m + l[i]
print(m)
Problem p02711 (python)

Fixed submission:
a = input()

b = 0
for i in a:
  if i == '7':
    print('Yes')
    break
  b+=1
  if b == 3:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
S = list(input())
S_len = len(S)
ans = 0
i = 0
for _ in range(S_len):
  if S[0] == 'R':
    ans += S[1:].count('B') * S[1:].count('G')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='R' and S[j+1] !='R':
          ans-=1
      except:
        pass
  if S[0] == 'B':
    ans += S[1:].count('R') * S[1:].count('G')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='B' and S[j+1] !='B':
          ans-=1
      except:
        pass
  if S[0] == 'G':
    ans += S[1:].count('B') * S[1:].count('R')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='G' and S[j+1] !='G':
          ans-=1
      except:
        pass
  S  = S[1:]
print(ans)
Problem p02729 (python)

Fixed submission:
import numpy as np
a = [int(i) for i in list(input().split())]
b = int((a[0]*(a[0]-1) +a[1]*(a[1]-1))/2)

print(b)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import product
 
H,W,K = map(int,input().split())
S = [input() for i in range(H)]
 
C = [[int(S[i][k]) for i in range(H)] for k in range(W)]
answer = H*W #出力がこれを超えることはない
for X in product([False,True],repeat = H-1):
  M = [[0]]
  ans = sum(X)
  if ans > answer:#初期値がanswerよりも大きかったら考える必要がない
    continue
  for i,x in enumerate(X):#配列Mの作成
    if x:
      M.append([])
    M[-1].append(i+1)
  D = [0]*len(M)
  for c in C:
    for k,m in enumerate(M):
      D[k] += sum(c[i] for i in m)#k番目の要素に足していく
      #Dにどんどん代入することによってどの列まで足すことができるか算出することができる
    if any(d>K for d in D):#一つでもKを超えていたら
      ans += 1
      if ans >answer:
        break
      D = [sum(c[i] for i in m) for m in M]#超えた行について再び調査
      if any(d>K for d in D):
        ans = answer + 1
        #デフォルトanswerの結果より高い値にしてこの結果が出力にならないように設定する
        break
  answer = min(answer,ans)#あるXに対してanswerを算出(更新)
print(answer)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import product
 
H, W, K = map(int, input().split())
S = [input() for _ in range(H)]
 
i = 0
while i < len(S):
  if '1' in S[i]:
    i += 1
  else:
    del S[i]
H = len(S)
 
C = [[int(s[i]) for s in S] for i in range(W)]#列を一括りにする
 
total = sum(sum(c) for c in C)#すべての値の合計を算出
 
if total <= K:
  answer = 0
else:
  answer = H * W
  for X in product([False, True], repeat=H-1):#Hは行数
    #あるXについて一回目のfor文が回る
    ans = sum(X)#Trueの数を換算
    if ans > answer:
      continue
    M = [[0]]
    for i, x in enumerate(X):
      if x:#Trueなら実行
        M.append([])#Trueの数の配列が作成される
      M[-1].append(i+1)#一番最後にその番目をappendする
    print('M{}'.format(M))
    D = [0] * len(M)#初期値を設定
    for c in C:
      print('c{}'.format(c))
      for k, m in enumerate(M):
        print('m{}'.format(m))
        D[k] += sum(c[i] for i in m)#k番目の要素に足していく
        #Dにどんどん代入することによってどの列まで足すことができるか算出することができる
      print('D1{}'.format(D))
      if any(d > K for d in D):#一つでもKを超えていたら
        ans += 1
        if ans > answer:
          break
        D = [sum(c[i] for i in m) for m in M]#Dの更新(1番最初のDに戻る)
        print('D2{}'.format(D))
        if any(d > K for d in D):#一つでもKを超えていたら
          ans = answer + 1#ansの更新
          break
    answer = min(answer, ans)

print(answer)
Problem p02771 (python)

Fixed submission:
import collections
a = input().split()
c = list(collections.Counter(a).values())
b = 0
for k in c:
  b += 1
  if k == 2:
    print("Yes")
    break
  elif b == 3:
    print("No")
  elif k == 3:
    print("No")

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

line = [int(k) for k in input().split()]
b = 0
for k in range(len(line)):
  if line[k] % 2 == 0:
    if not line[k] % 5 == 0 and not line[k] % 3 == 0:
      print("DENIED")
      break
  elif k == a-1:
    print("APPROVED")
Problem p02773 (python)

Fixed submission:
import collections
a = int(input())
line = [input() for k in range(a)]
c = collections.Counter(line)
common = c.most_common()
max_number = common[0][1]
a = len(common)
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)

Buggy submission (verdict: Runtime Error):
import collections
a = int(input())
line = [input() for k in range(a)]
c = collections.Counter(line)
common = c.most_common()
max_number = common[0][1]
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)

Buggy submission (verdict: Runtime Error):
import collections
a = int(input())
line = [input() for k in range(a)]
c = collections.Counter(line)
max_number = max(c.values())
common = c.most_common()
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)

Buggy submission (verdict: Runtime Error):
import collections
a = int(input())
line = [input() for k in range(a)]
 
c = collections.Counter(line)
 
max_number = max(c.values())
common = c.most_common()
 
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)

Buggy submission (verdict: Runtime Error):
import collections
a = int(input())
line = [input() for k in range(a)]

c = collections.Counter(line)

max_number = max(c.values())
common = c.most_common()

max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)
Problem p02777 (python)

Fixed submission:
a = input().split()
b = [int(k) for k in input().split()]
c = input()

if a[0] == c:
  b[0] -= 1
else:
  b[1] -= 1

print('{0} {1}'.format(b[0],b[1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
 
first_int = [int(k) for k in input().split()]
a = first_int[0]
b = first_int[1]
secound_list = [int(k) for k in input().split()]
 
all_sigm = [k for k in secound_list]
max_index = all_sigm.index(max(all_sigm))
print(sum(all_sigm[max_index:max_index+b]))

Buggy submission (verdict: Runtime Error):
import numpy as np
 
first_int = [int(k) for k in input().split()]
a = first_int[0]
b = first_int[1]
secound_list = [int(k) for k in input().split()]
 
def sigm(k):
  return k*(k+1)/2
 
all_sigm = [sigm(k) for k in secound_list]
all_sigm_ = [sum(all_sigm[k:k+b]) for k in range(a)]
print(max(all_sigm_))
Problem p02726 (python)

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

X -= 1
Y -= 1
k = [0]*N

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-X)+1+abs(Y-j)
        c = abs(j-X)+1+abs(Y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])

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

X -= 1
Y -= 1
k = [0]*N

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-x)+1+abs(y-j)
        c = abs(j-x)+1+abs(y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])

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

X -= 1
Y -= 1
k = [0]*n

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-x)+1+abs(y-j)
        c = abs(j-x)+1+abs(y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])
Problem p02831 (python)

Fixed submission:
def g(x, y):
	while y > 0:
		x, y = y, x%y
	return x
def l(x, y):
	return x // g(x, y) * y

a, b = map(int, input().split())


print(l(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 p02835 (python)

Fixed submission:
l = input()
a, b, c = map(int, l.split())

sum=0
sum+=a
sum+=b
sum+=c

if sum >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, list(input())

a += b 
a += c

if a > 22:
    print("bust")
else:
    print("win")

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

a += b 
a += c

if a > 22:
    print("bust")
else:
    print("win")
Problem p02773 (python)

Fixed submission:
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Buggy submission (verdict: Runtime Error):
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = collections.Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Buggy submission (verdict: Runtime Error):
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = collections.Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))
Problem p02831 (python)

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

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