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

Fixed submission:
A,B=map(int,input().split())
N=B-A
X=N*(N+1)//2
print(X-B)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
B-A=N
X=N*(N+1)//2
print(X-B)
Problem p03385 (python)

Fixed submission:
a = input()
if "".join(sorted(a))=="abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
if .join(sorted(a))=="abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
if join(sorted(a))=="abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
if a in n and b in n and c in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=list(input())
if a in n and b in n and c in n:
  print("Yes")
else:
  print("No")
Problem p03424 (python)

Fixed submission:
input()
A=map(str,input().split())
if len(set(A))==4:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
input()
A=map(str,input().split())
if P in A and W in A and Y in A and G in A:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(str,input().split()))
if P in A and W in A and Y in A and G in A:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(str,input().split())
if P in A and W in A and Y in A and G in A:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(str,input().split())
if P in N and W in N and Y in N and G in N:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(str,input().split()))
if P in N and W in N and Y in N and G in N:
  print("Four")
else:
  print("Three")
Problem p03434 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
x=0
y=0
for i in range(N):
  if i%2==0:
    x+=a[i]
  else:
    y+=a[i]
print(abs(x-y))

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
x,y=0.0
for i in range(N):
  if i%2==0:
    x+=i
  else:
    y+=i
print(x-y)
Problem p03456 (python)

Fixed submission:
c=int(input().replace(" ",""))
if c**0.5 % 1 !=0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
c=int(input.replace(" ",""))
if c**0.5 % 1 !=0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c=int("a"+"b")
if c**0.5 % 1 !=0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=int("a"+"b")
if c**.5 % 1 !=0:
  print("No")
else:
  print("Yes")
Problem p03502 (python)

Fixed submission:
N=int(input())
X=sum(list(map(int,str(N))))
if N % X ==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=str(input())
A=sum(list(map(int, list(N))))
if N % A ==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=sum(list(map(int, list(N))))
if N % A ==0:
  print("Yes")
else:
  print("No")
Problem p03671 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a+b<=a+c:
  print(min(a+b,b+c))
else:
  print(min((a+c,b+c))
Problem p03680 (python)

Fixed submission:
N=int(input())
a=[int(input()) for _ in range(N)]
X=1
i=1
while a[i-1]!=2 and X<=N:
    X+=1
    i=a[i-1]
if X>N:
  print(-1)
else:
  print(X)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
X=1
i=1
while a[i-1]!=2 and X<=n:
    X+=1
    i=a[i-1]
if X>N:
  print(-1)
else:
  print(X)
Problem p03737 (python)

Fixed submission:
a,b,c=input().split()
x=a[0]+b[0]+c[0]
print(x.upper())

Buggy submission (verdict: Runtime Error):
a,b,c=input().split
x=a[0]+b[0]+c[0]
print(x.upper())
Problem p03852 (python)

Fixed submission:
A=input()
X=["a","i","u","e","o"]
if A in X:
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
A=input()
X=[a,i,u,e,o]
if A in X:
  print("vowel")
else:
  print("consonant")
Problem p02700 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
if ((C+B-1)//B) > ((A+D-1)//D):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
if (C//B) < (A//D):
  print("No")
elif (C//B) = (A//D) and A%D = 0:
  print("No")
else:
  print("Yes")
Problem p02705 (python)

Fixed submission:
R = int(input())
py = 3.1415

print(2*R*py)

Buggy submission (verdict: Runtime Error):
print(int(iinput())*3.1415)
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
A = []
for x in range(min(X),max(X)+1):
  S = 0
  for i in range(N):
    S = S + (X[i] - x)**2
  A.append(S)
print(min(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
A = []
for x in range(min(X)+1,max(X)):
  S = 0
  for i in range(N):
    S = S + (X[i] - x)**2
  A.append(S)
print(min(A))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
if X < A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
X,A = input(), input()
if X < A :
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
X,A = map(int, input().split())
if X < A 
print(0)
else
print(10)

Buggy submission (verdict: Runtime Error):
X,A = map(int,input(),split())
if X<A print(0)
else print(10)
Problem p03085 (python)

Fixed submission:
b = input()
if b =='A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
else:
  print('C')

Buggy submission (verdict: Runtime Error):
b = input()
if b ='A':
  print('T')
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
else:
  print('C')
Problem p03385 (python)

Fixed submission:
S = input()
if S[0] != S[1] and S[1] != S[2] and S[2] != S[0]:
      print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[1] != S[2] and S[2] != S[3] and S[3] != S[1]:
  print("Yes")
else:
  print("No")
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
if A >= (N % 500):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
if A >= N%500:
  print("Yes")
else:
  print("No")
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
Y = int((X - A)/B)
print(X - A - (B*Y))

Buggy submission (verdict: Runtime Error):
X = input()
A = input()
B = input()
Y = int((X - A)/B)
print(X - A - (B*Y))
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())
print(X + Y + Z)
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2*G - R)

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int(input())
print(2G - R)
Problem p03852 (python)

Fixed submission:
c = input()
lists = ["a","e", "i", "o", "u"]
if c in lists:
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c = input()
if c = "a" or "i" or "u" or "e" or "o":
  print("vowel")
else:
  print("consonant")
Problem p02642 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
a_max = max(A)
table = [True for i in range(a_max+1)]
for a in A:
    i = 2
    k = a * 2
    while k <= a_max:
        table[k] = False
        k += a
count = 0
for i, a in enumerate(A):
    if i < N - 1 and A[i] == A[i+1]:
        table[a] = False
    if table[a]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import bisect
import copy
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
table = [True for i in range(N)]
cands = [i for i in range(N)]
k = 0
while k < len(cands):
    i = cands[k]
    new_cands = copy.deepcopy(cands)
    if i < N-1 and A[i] == A[i+1]:
        idx = bisect.bisect_left(new_cands, i)
        del new_cands[idx]
    for j in cands[k+1:]:
        if A[j] % A[i] == 0:
            idx = bisect.bisect_left(new_cands, j)
            del new_cands[idx]
    if len(new_cands) > 0 and new_cands[k] == cands[k]:
        k += 1
    cands = copy.deepcopy(new_cands)
print(len(cands))
Problem p02647 (python)

Fixed submission:
# tokio marine 2020 C.Lamps
import copy
# N = int(input())
N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

for i in range(K):
    B = [0 for k in range(N)]
    for j in range(N):
        L = A[j]
        l = max(j-L, 0)
        r = min(j+L, N-1)
        B[l] += 1
        if r + 1 < N:
            B[r+1] -= 1
    for j in range(1, N):
        B[j] += B[j-1]
    A = copy.deepcopy(list(B))
    if len(set(A)) == 1 and A[0] == N:
        break
print(*A)

Buggy submission (verdict: Runtime Error):
import copy
import numpy as np
# N = int(input())
N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

for i in range(K):
    B = np.array([0 for k in range(N)])
    for j in range(N):
        L = A[j]
        B[max(j-L, 0): min(j+L+1, N)] += 1
    A = copy.deepcopy(list(B))
    if len(set(A)) == 1 and A[0] == N:
        break
print(*A)
Problem p02660 (python)

Fixed submission:
import math
N = int(input())
# A, B = [i for i in input().split()]


def prime_factorization(n):
    # n = p1**e1 * p2**e2... pm**emのように素因数分解を行う。リストが空の場合は素数ということ
    fact_list = []
    for p in range(2, int(math.sqrt(n)) + 1):
        e = 0
        while n % p == 0:
            n //= p
            e += 1
        if e > 0:
            fact_list.append((p, e))
    if n != 1:
        fact_list.append((n, 1))
    return fact_list


prime_list = prime_factorization(N)
if len(prime_list) == 0:
    print(0)
else:
    count = 0
    for p, e in prime_list:
        a = 1
        sum_a = 0
        while True:
            sum_a += a
            if e < sum_a:
                break
            a += 1
        count += a - 1
    print(count)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
# A, B = [i for i in input().split()]
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
cands = []
for i in range(2, int(math.sqrt(N))+1):
    if N % i == 0:
        cands.append(i)
        cands.append(N%i)

if is_prime(N):
    print(1)
else:
    count = 0
    n = N
    for c in cands:
        if c > n:
            break
        if n % c == 0:
            n //= c
            count += 1
    print(count)
Problem p02898 (python)

Fixed submission:
N, K = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
cnt = 0
for h in H:
    if h >= K:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):

N, K = [int(_) for _ in input().split()]
h = [int(_) for _ in input().split()]
print(len([i for i in h if
Problem p02901 (python)

Fixed submission:
# N = int(input())
N, M = [int(i) for i in input().split()]
key = []
for i in range(M):
    a, b = [int(_) for _ in input().split()]
    cs = [int(_) for _ in input().split()]
    s = 0
    for c in cs:
        c -= 1
        s |= 1 << c
    key.append([s, a])

INF = 10**9
dp = [INF for i in range(2**N)]
dp[0] = 0
for i in range(2**N):
    for j in range(M):
        t = i | key[j][0]
        cost = key[j][1]
        dp[t] = min(dp[t], dp[i] + cost)
ans = dp[-1]
if ans == INF:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
# N = int(input())
N, M = [int(i) for i in input().split()]
key = []
for i in range(M):
    a, b = [int(_) for _ in input().split()]
    cs = [int(_) for _ in input().split()]
    s = 0
    for c in cs:
        c -= 1
        s |= 1 << c
    key.append([s, a])

INF = 10**9
dp = [INF for i in range(N**2)]
dp[0] = 0
for i in range(N**2):
    for j in range(M):
        t = i | key[j][0]
        cost = key[j][1]
        dp[t] = min(dp[t], dp[i] + cost)
ans = dp[-1]
if ans == INF:
    print(-1)
else:
    print(ans)
Problem p02913 (python)

Fixed submission:
N = int(input())
S = input()
ans = 0
for i in range(1, N):
    cnt = 0
    for j in range(N-i):
        if S[j] == S[i+j]:
            cnt += 1
            if cnt == i:
                ans = max(ans, i)
                break
        else:
            ans = max(ans, cnt)
            cnt = 0
    ans = max(ans, cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = 0
for i in range(1, N):
    # cnt = 0
    pass
    for j in range(N-i):
    #     if S[j] == S[i+j]:
    #         cnt += 1
    #     else:
    #         ans = max(ans, min(cnt, i))
    #         cnt = 0
    # ans = max(ans, min(cnt, i))
    pass
print(ans)
Problem p02983 (python)

Fixed submission:
l, r = [int(i) for i in input().split()]

if r - l + 1 >= 2019:
    print(0)
else:
    ans = 2018
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j) % 2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
l, r = [int(i) for i in input().split()]

if r - l + 1 >= 2019:
    print(0)
else:
    ans = 2018
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%2019)
print(ans)
Problem p03061 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
if n == 2:
  print(max(a))
else:
  a0 = a[0]
  a1 = a[1]
  r = 0
  while True:
    r = a1 % a0
    if r == 0:
      b0 = a0
      break
    elif r > a0:
      a1, a0 = r, a0
    else:
      a1, a0 = a0, r
  a1 = a[1]
  a2 = a[2]
  r = 0
  while True:
    r = a2 % a1
    if r == 0:
      b1 = a1
      break
    elif r > a1:
      a2, a1 = r, a1
    else:
      a2, a1 = a1, r
  a0 = a[0]
  a2 = a[2]
  r = 0
  while True:
    r = a2 % a0
    if r == 0:
      b2 = a0
      break
    elif r > a0:
      a2, a0 = r, a0
    else:
      a2, a0 = a0, r
  max_a = max(b0,b1,b2)
  kouho = []
  for j in range(max_a,1,-1):
    if max_a % j == 0:
      c = list(map(lambda x: x % j,a))
      c_ng = [i for i in c if i > 0]
    #print("j=",j,"c=",c,"c_ng=",c_ng)
      if len(c_ng) <= 1:
        ans = j
        break
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
a0 = a[0]
a1 = a[1]
r = 0
while True:
  r = a1 % a0
  if r == 0:
    b0 = a0
    break
  elif r > a0:
    a1, a0 = r, a0
  else:
    a1, a0 = a0, r
a1 = a[1]
a2 = a[2]
r = 0
while True:
  r = a2 % a1
  if r == 0:
    b1 = a1
    break
  elif r > a1:
    a2, a1 = r, a1
  else:
    a2, a1 = a1, r
a0 = a[0]
a2 = a[2]
r = 0
while True:
  r = a2 % a0
  if r == 0:
    b2 = a0
    break
  elif r > a0:
    a2, a0 = r, a0
  else:
    a2, a0 = a0, r
max_a = max(b0,b1,b2)
for j in range(max_a,1,-1):
  c = list(map(lambda x: x % j,a))
  c_ng = [i for i in c if i > 0]
  #print("j=",j,"c=",c,"c_ng=",c_ng)
  if len(c_ng) <= 1:
    ans = j
    break
print(ans)
Problem p03069 (python)

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

if "." not in s or "#" not in s:
    print(0)
else:
    ans = len(s)

    s = s[s.find("#"):n-s[::-1].find(".")]
    if s == "":
        print(0)
    else:
        cnt_b = [0 for i in range(len(s))]
        cnt = 0
        for i in range(len(s)):
            if s[i] == "#":
                cnt += 1
            cnt_b[i] = cnt
        ans = min(ans, len(s)-cnt_b[-1])
        for i in range(len(s)):
            ans = min(ans, cnt_b[i] + (len(s)-cnt_b[-1])-(i+1-cnt_b[i]))
        print(ans)

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

if "." not in s or "#" not in s:
    print(0)
else:
    ans = len(s)

    s = s[s.find("#"):n-s[::-1].find(".")]
    cnt_b = [0 for i in range(len(s))]
    cnt = 0
    for i in range(len(s)):
        if s[i] == "#":
            cnt += 1
        cnt_b[i] = cnt
    ans = min(ans, len(s)-cnt_b[-1])
    for i in range(len(s)):
        ans = min(ans, cnt_b[i] + (len(s)-cnt_b[-1])-(i+1-cnt_b[i]))
    print(ans)
Problem p03074 (python)

Fixed submission:
n, k = [int(i) for i in input().split()]
s = [0,1] + [int(i) for i in list(input())] + [1,0]
down = [i for i in range(n+3) if s[i] == 1 and s[i+1] == 0]
up = [i for i in range(n+3) if s[i] == 0 and s[i+1] == 1]
#print(s)
#print(down)
#print(up)
ans = 1
if k >= len(up):
  ans = n
else:
  if down[k] - up[0] - 1 > ans:
    ans = down[k] - up[0] - 1
  for i in range(1,len(up)-k-1):
    if down[i + k] - up[i] > ans:
      ans = down[i + k] - up[i]
  if down[len(up)-1] - up[len(up)-k -1] - 1 > ans:
    ans = down[len(up)-1] - up[len(up)-k -1] - 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
s = [0,1] + [int(i) for i in list(input())] + [1,0]
down = [i for i in range(n+3) if s[i] == 1 and s[i+1] == 0]
up = [i for i in range(n+3) if s[i] == 0 and s[i+1] == 1]
#print(s)
#print(down)
#print(up)
if k >= len(up):
  ans = n
else:
  if down[k] - up[0] - 1 > ans:
    ans = down[k] - up[0] - 1
  for i in range(1,len(up)-k-1):
    if down[i + k] - up[i] > ans:
      ans = down[i + k] - up[i]
  if down[len(up)-1] - up[len(up)-k -1] - 1 > ans:
    ans = down[len(up)-1] - up[len(up)-k -1] - 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
s = [0,1] + [int(i) for i in list(input())] + [1,0]
down = [i for i in range(n+3) if s[i] == 1 and s[i+1] == 0]
up = [i for i in range(n+3) if s[i] == 0 and s[i+1] == 1]
#print(s)
#print(down)
#print(up)
ans = 1
if down[k] - up[0] - 1 > ans:
  ans = down[k] - up[0] - 1
for i in range(1,len(up)-k-1):
  if down[i + k] - up[i] > ans:
    ans = down[i + k] - up[i]
if down[len(up)-1] - up[len(up)-k -1] - 1 > ans:
  ans = down[len(up)-1] - up[len(up)-k -1] - 1
print(ans)
Problem p03089 (python)

Fixed submission:
n = int(input())
b = [int(i) for i in input().split()]
flag = True
for i in range(n):
    if b[i] > i+1:
        flag = False
        break

if not flag:
    print(-1)
else:
    ans = []
    while len(b) > 0:
        for m in range(max(b), 0, -1):
            if b[m-1] == m:
                ans.append(b[m-1])
                del b[m-1]
                break
    ans = ans[::-1]
    print(*ans, sep="\n")

Buggy submission (verdict: Runtime Error):
n = int(input())
b = [int(i) for i in input().split()]
flag = True
for i in range(n):
    if b[i] > i+1:
        flag = False
        break

if not flag:
    print(-1)
else:
    ans = []
    while len(b) > 0:
        for m in range(max(b), 0, -1):
            if b[m-1] == m:
                ans.append(b[m-1])
                del b[m-1]
                break
ans = ans[::-1]
print(*ans, sep="\n")
Problem p03161 (python)

Fixed submission:
# N = int(input())


N, K = [int(i) for i in input().split()]
h = [0] + [int(i) for i in input().split()]
INF = 10 ** 9
dp = [INF for i in range(N+1)]
dp[1] = 0
for j in range(1, N+1):
    for i in range(1, K+1):
        if j > i:
            dp[j] = min(dp[j], dp[j-i] + abs(h[j] - h[j-i]))

print(dp[N])

Buggy submission (verdict: Runtime Error):
# N = int(input())
import sys
from functools import lru_cache

sys.setrecursionlimit(100000)


N, K = [int(i) for i in input().split()]
h = [0] + [int(i) for i in input().split()]


@lru_cache(maxsize=None)
def solve(n):
    if n <= 1:
        return 0
    cost = []
    for i in range(1, K+1):
        if n > i:
            cost.append(solve(n-i) + abs(h[n] - h[n-i]))
    return min(cost)

print(solve(N))
Problem p03196 (python)

Fixed submission:
n, p = [int(i) for i in input().split()]
tmp = p**(1/n)
if tmp - int(tmp) > 0.999:
    max_x = int(tmp) + 1
else:
    max_x = int(tmp)
ans = 1
for i in range(max_x, 1, -1):
    if p % pow(i,n) == 0:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, p = [int(i) for i in input().split()]
max_x = int(p**(1/n))
ans = 1
if n >= p:
    print(1)
else:
    for i in range(max_x+1, 1, -1):
        if p % int(math.pow(i,n)) == 0:
            ans = i
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, p = [int(i) for i in input().split()]
max_x = int(p**(1/n))
ans = 1
if n >= p:
    print(1)
else:
    for i in range(max_x+1, 1, -1):
        if p % math.pow(i,n) == 0:
            ans = i
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, p = [int(i) for i in input().split()]
max_x = int(p**(1/n))
ans = 1
for i in range(max_x+1, 1, -1):
    if p % math.pow(i,n) == 0:
        ans = i
        break
print(ans)
Problem p03240 (python)

Fixed submission:
N = int(input())
x = []
y = []
h = []
key = 0
for i in range(N):
    tmp = [int(i) for i in input().split()]
    if tmp[2] != 0:
        key = i
    x.append(tmp[0])
    y.append(tmp[1])
    h.append(tmp[2])

for Cx in range(100 + 1):
    for Cy in range(100 + 1):
        correct_flag = True
        H = abs(x[key] - Cx) + abs(y[key] - Cy) + h[key]
        for i in range(N):
            if h[i] == 0:
                if abs(x[i] - Cx) + abs(y[i] - Cy) < H:
                    correct_flag = False
                    break
            else:
                if abs(x[i] - Cx) + abs(y[i] - Cy) + h[i] != H:
                    correct_flag = False
                    break
        if correct_flag:
            print(Cx, Cy, H)
            break

Buggy submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
h = []
for _ in range(N):
    tmp = [int(i) for i in input().split()]
    if tmp[2] == 0:
        continue
    x.append(tmp[0])
    y.append(tmp[1])
    h.append(tmp[2])

for Cx in range(100 + 1):
    for Cy in range(100 + 1):
        correct_flag = True
        H = abs(x[0] - Cx) + abs(y[0] - Cy) + h[0]
        for i in range(1, N):
            if abs(x[i] - Cx) + abs(y[i] - Cy) + h[i] != H:
                correct_flag = False
                break
        if correct_flag:
            print(Cx, Cy, H)
            break

Buggy submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
h = []
for _ in range(N):
    tmp = [int(i) for i in input().split()]
    if tmp[2] == 0:
        continue
    x.append(tmp[0])
    y.append(tmp[1])
    h.append(tmp[2])

for Cx in range(100 + 1):
    for Cy in range(100 + 1):
        correct_flag = True
        H = abs(x[0] - Cx) + abs(y[0] - Cy) + h[0]
        for i in range(1, N):
            if abs(x[i] - Cx) + abs(y[i] - Cy) + h[i] != H:
                correct_flag = False
                break
        if correct_flag:
            print(Cx, Cy, H)
            break
    if correct_flag:
        break
Problem p03241 (python)

Fixed submission:
import math
N, M = [int(i) for i in input().split()]
for i in range(math.ceil(M/N), 0, -1):
  if M % i == 0:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
for i in range(min(math.ceil(math.sqrt(M)), M//N), 0, -1):
  if M % i == 0:
    print(i)
    break
Problem p03244 (python)

Fixed submission:
n = int(input())
v = [int(i) for i in input().split()]
MAX_V = 100001
even = [[i, 0] for i in range(MAX_V)]
odd = [[i, 0] for i in range(MAX_V)]
for ni in range(n//2):
    even[v[ni*2]][1] += 1
    odd[v[ni*2+1]][1] += 1
even.sort(key=lambda x: x[1], reverse=True)
odd.sort(key=lambda x: x[1], reverse=True)

if even[0][0] == odd[0][0]:
    if even[1][1] > odd[1][1]:
        print(n-even[1][1]-odd[0][1])
    else:
        print(n-even[0][1]-odd[1][1])
else:
    print(n - even[0][1] - odd[0][1])

Buggy submission (verdict: Runtime Error):
n = int(input())
v = [int(i) for i in input().split()]
MAX_V = 100000
even = [[i, 0] for i in range(MAX_V)]
odd = [[i, 0] for i in range(MAX_V)]
for ni in range(n//2):
    even[v[ni*2]][1] += 1
    odd[v[ni*2+1]][1] += 1
even.sort(key=lambda x: x[1], reverse=True)
odd.sort(key=lambda x: x[1], reverse=True)

if even[0][0] == odd[0][0]:
    if even[1][1] > odd[1][1]:
        print(n-even[1][1]-odd[0][1])
    else:
        print(n-even[0][1]-odd[1][1])
else:
    print(n - even[0][1] - odd[0][1])