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

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

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k]:
                    ans += 1
print(ans)

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

ans = 0
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if l[k]<l[i]+l[j]:
        if l[i]!=l[j] and l[j]!=l[k]:
            ans +=1
            
print(ans)

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

ans = 0
for i in N:
  for j in range(i+1,N):
    for k in range(j+1,N):
      if l[k]<l[i]+l[j]:
        if l[i]!=l[j] and l[j]!=l[k]:
        ans +=1

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

ans = 0
for i in N:
  for j in range(i+1,N):
    for k in range(j+1,N):
      if l[k]<l[i]+l[j] and i!=j and j!=k:
        ans +=1

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in N:
  for j in range(i+1,N):
    for k in range(j+1,N):
      if k<i+j and i!=j and j!=k:
        ans +=1
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
print(N**2-A)
Problem p03598 (python)

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

         
ans =0 
for i in l:
	s = int(i)
	ans += min(s,K-s)
print(ans*2)

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

print(N,K,l)
         
for i in l:
     ans = 0    
	 ans += min(i,K-i)
    
print(ans*2)

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

for i in l:
     ans = 0    
	ans += min(i,K-i)
    
print(ans*2)
Problem p03047 (python)

Fixed submission:
a,b=map(int,input().split());print(a-b+1)

Buggy submission (verdict: Runtime Error):
print(int(input())-int(input())+1)
Problem p03502 (python)

Fixed submission:
n=input();print("YNeos"[int(n)%sum([int(i)for i in n])!=0::2])

Buggy submission (verdict: Runtime Error):
n=input();print("YNeos"[int(n)%(int(n[0])+int(n[1]))!=0::2])
Problem p03563 (python)

Fixed submission:
a,b=map(int,open(0));print(2*b-a)

Buggy submission (verdict: Runtime Error):
r,g=map(int,input().split());print(g*2-r)
Problem p03239 (python)

Fixed submission:
N, T = [int(i) for i in input().split(" ")]
c = []
t = []

for i in range(N):
    t = [int(i) for i in input().split(" ")]
    if t[1] <= T:
        c.append(t[0])
        t.append(t[1])

if c == []:
    print("TLE")
else:
    print(min(c))

Buggy submission (verdict: Runtime Error):
N, T = [int(i) for i in input().split(" ")]
c = []
t = []

for i in range(N):
    t = [int(i) for i in input().split(" ")]
    if t[1] <= T:
        c.append(t[0])
        t.append(t[1])

print(min(c))
Problem p03267 (python)

Fixed submission:
L = int(input())
r = 0
while 2 ** r <= L:
    r += 1
r -= 1

ans = []
N = r + 1
for i in range(1, N):
    ans.append((i, i + 1, 0))
    ans.append((i, i + 1, 2 ** (i - 1)))
    
for t in range(N - 1, 0, -1):
    if L - 2 ** (t - 1) >= 2 ** r:
        ans.append((t, N, L - 2 ** (t - 1)))
        L -= 2 ** (t - 1)
        
print(N, len(ans))
for i in ans:
    print(i[0], i[1], i[2])

Buggy submission (verdict: Runtime Error):
L = int(input())
r = 0
while 2 ** r <= L:
    r += 1
r -= 1

ans = []
N = r + 1
for i in range(1, N):
    ans.append((i, i + 1, 0))
    ans.append((i, i + 1, 2 ** (i - 1)))
    
for t in range(N - 1, 0, -1):
    if L - 2 ** (t - 1) >= 2 ** r:
        ans.append((L - 2 ** (t - 1)))
        L -= 2 ** (t - 1)
        
print(N, len(ans))
for i in ans:
    print(i[0], i[1], i[2])
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
q = [i for i in range(-110, 210)]
if n != 0:
  p = list(map(int, input().split()))
  for i in p:
    q[i+110] = -500

if x in q:
  print(x)
  exit()

l = []

for i in range(100):
  if x+i in q:
    l.append(x+i)
    break
for j in range(100):
  if x-j in q:
    l.append(x-j)
    break

if abs(l[0]-x) < abs(l[1]-x):
  print(l[0])
elif abs(l[0]-x) > abs(l[1]-x):
  print(l[1])
else:
  print(l[1])

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
q = [i for i in range(1, 101)]
if n != 0:
  p = list(map(int, input().split()))
  for i in p:
    q[i-1] = -100

if x in q:
  print(x)
  exit()

l = []

for i in range(100):
  if x+i in q:
    l.append(x+i)
    break
for j in range(100):
  if x-i in q:
    l.append(x-i)
    break

if len(l) == 1:
  print(l[0])
  exit()

if abs(l[0]-x) < abs(l[1]-x):
  print(l[0])
elif abs(l[0]-x) > abs(l[1]-x):
  print(l[1])
else:
  print(l[1])
Problem p02678 (python)

Fixed submission:
import queue

N, M = map(int, input().split())
parent = [-1] * N # -1なら未訪問
adj = [[] for _ in range(N)] # 隣接リスト作成
for i in range(M):
  a, b = map(int, input().split())
  adj[a-1].append(b)
  adj[b-1].append(a)
q = queue.Queue() # 自分の部屋、親の部屋
q.put([1, 0]) # 1の親は0
while not q.empty():
  x, y = q.get()
  if parent[x-1] != -1: # もし自分の部屋が訪問済みなら
    continue
  parent[x-1] = y # 自分の部屋の親yを指定
  for i in adj[x-1]:
    if parent[i-1] == -1:
      q.put([i, x])
print('Yes')
for j in parent[1:]:
  print(j)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = []
for i in range(M):
  x = list(map(int, input().split()))
  l.append(x)
print(l)
m = []
n = [[1]]

for j in range(M):
  for i in range(M):
    for k in range(len(n[j])):
      if l[i][0] == n[j][k] or l[i][1] == n[j][k]:
        if l[i][0] == n[j][k]:
          m.append(l[i][1])
        else:
          m.append(l[i][0])
        l[i] = [0, 0]
  n.append(m)
  m = []
  print(n)

for i in range(M -1):
Problem p02705 (python)

Fixed submission:
R = int(input())

l = 2 * R * 3.141592

print(l)

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

B = [0] * N

for i in A:
  B[i-1] = int(B[i-1]) + 1
  
for j in B:
  print(j)
Problem p02796 (python)

Fixed submission:
from operator import itemgetter

N = int(input())
l = []
for i in range(N):
  a, b = map(int, input().split())
  s = [a-b, a+b]
  l.append(s)

l.sort(key = itemgetter(1))
cnt = 0
s = - 10 ** 10
for i in range(N):
  if l[i][0] >= s:
    s = l[i][1]
  else:
    cnt += 1
print(N-cnt)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter

N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]
ans = []
for i in range(N):
  l[i].append(l[i][0] - l[i][1])
  l[i].append(l[i][0] + l[i][1])
  del l[i][:2]
l.sort(key = itemgetter(1))

def search(x):
  for i in range(x, len(l)):
    if l[i][0] < l[i-1][1]:
      del(l[i])
      ans.append(1)
      search(x)
      break
search(1)
if ans == []:
  print(N)
else:
  print(N-sum(ans))
Problem p02801 (python)

Fixed submission:
C = str(input())
print(chr(ord(C) + 1))

Buggy submission (verdict: Runtime Error):
C = str(input())
print chr(ord(C) + 1)
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left

N = int(input())
L = list(map(int, input().split()))
L.sort()
cnt = 0
for i in range(N-2):
  for j in range(i+1, N-1):
    cnt += bisect_left(L, L[i] + L[j]) - j - 1
print(cnt)

Buggy submission (verdict: Runtime Error):
def binary_search(x, li, value):
  l = []
  left = x+1
  y = x
  right = len(li) - 1
  while left <= right:
    mid = (left + right) // 2
    if li[mid] > value - 1:
      right = mid - 1
    elif li[mid] < value - 1:
      y = mid
      left = mid + 1
    else:
      for i in range(1, 1000):
        if li[mid] == li[mid + i]:
          y = mid + i
        else:
          y = mid
          break
  return y
  
N = int(input())
L = list(map(int, input().split()))
L.sort()
cnt = 0
for i in range(N-2):
  for j in range(i+1, N-1):
    cnt += binary_search(j, L, L[i]+L[j]) - j
print(cnt)
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
N, Q = map(int,input().split())
graph = [[] for _ in range(N+1)]
point = [0] * (N+1)
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

# dfsをします。
def dfs(x, parent):
    point[x] += point[parent]
    for i in range(len(graph[x])):
        if graph[x][i] == parent:
            continue
        dfs(graph[x][i], x)
dfs(1, 0)
point_str = [str(n) for n in point]
ans = ' '.join(point_str[1:])
print(ans)

Buggy submission (verdict: Runtime Error):
N, Q = map(int,input().split())
graph = [[] for _ in range(N+1)]
point = [0] * (N+1)
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

# dfsをします。
def dfs(x, parent):
    point[x] += point[parent]
    for i in range(len(graph[x])):
        if graph[x][i] == parent:
            continue
        dfs(graph[x][i], x)
dfs(1, 0)
point_str = [str(n) for n in point]
ans = ' '.join(point_str[1:])
print(ans)
Problem p03106 (python)

Fixed submission:
from fractions import gcd

A, B, K = map(int, input().split())
gcd = gcd(A, B)
l = []

for i in range(1, gcd+1):
  if gcd % i == 0:
    l.append(i)
  else:
    pass
l.reverse()
print(l[K-1])

Buggy submission (verdict: Runtime Error):
import math

A, B, K = map(int, input().split())
gcd = math.gcd(A, B)
l = []

for i in range(1, gcd+1):
  if gcd % i == 0:
    l.append(i)
  else:
    pass
l.reverse()
print(l[K-1])

Buggy submission (verdict: Runtime Error):
import math

A, B, K = map(int, input().split())
gcd = math.gcd(A, B)
l = []

for i in range(1, gcd+1):
  if gcd % i == 0:
    l.append(i)
  else:
    pass
l.reverse()
print(l[K-1])

Buggy submission (verdict: Runtime Error):
import math

A, B, K = map(int, input().split())
gcd = math.gcd(A, B)
l = []

for i in range(1, gcd+1):
  if gcd % i == 0:
    l.append(i)
  else:
    pass
l.reverse()
print(l[K-1])
Problem p02641 (python)

Fixed submission:
#ABC170 C 通せず
x, n = map(int, input().split())
seisulist = list(map(int, input().split()))
numlist = [i for i in range(0,102) if i not in seisulist]
xretu = [x]*len(numlist)
hikizan = [abs(s-t) for (s, t) in zip(numlist, xretu)]
sa = min(hikizan)
if x-sa not in seisulist:
    print(x-sa)
else:
    print(x+sa)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    seisulist = list(map(int, input().split()))
    if max(seisulist) > x:
        size = max(seisulist) + 1
    else:
        size = x + 1
    numlist = [i for i in range(1,size) if i not in seisulist]
    xretu = [x]*len(numlist)
    hikizan = [abs(s-t) for (s, t) in zip(numlist, xretu)]
    sa = min(hikizan)
    if x-sa not in seisulist:
        print(x-sa)
    else:
        print(x+sa)
Problem p03470 (python)

Fixed submission:
n=int(input())
d=list(map(int, [input() for i in range(n)]))
print(len(set(d)))

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")

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

for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(f'{x} {y} {n-x-y}')
            exit()

print('-1 -1 -1')

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

for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(f'{x} {y} {n-x-y}')
            exit()

print('-1 -1 -1')

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

for x in range(n + 1):
    for y in range(n + 1):
        for z in range(n + 1 - x - y):
            if x * 10000 + y * 5000 + z * 1000 == sum:
                print(f'{x} {y} {z}')
                exit()

print('-1 -1 -1')
Problem p03471 (python)

Fixed submission:
n, sum = [int(s) for s in input().split()]

for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(x, y, n-x-y)
            exit()

print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, sum = map(int, input().split())
for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(f'{x} {y} {n-x-y}')
            exit()

print(-1, -1, -1)

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

for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(f'{x} {y} {n-x-y}')
            exit()

print('-1 -1 -1')

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

for x in range(n + 1):
    for y in range(n - x + 1):
        if x * 10000 + y * 5000 + (n-x-y) * 1000 == sum:
            print(f'{x} {y} {n-x-y}')
            exit()

print('-1 -1 -1')
Problem p03494 (python)

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

cnt = 0
while True:
    if len([n for n in s if n % 2 != 0]) != 0:
        print (cnt)
        break
    else:
        s = list(map(lambda n: n / 2, s))
        cnt = cnt + 1

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

cnt = 0
while True:
    if len(n for n in s if n % 2 != 0) != 0:
        print (cnt)
        break
    else:
        s = list(map(lambda n: n / 2, s))
        cnt = cnt + 1

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

cnt = 0
while True:
    if len(n for n in s if n % 2 != 0) != 0:
        print (cnt)
        break
    else:
        s = map(lambda n: n / 2, s)
Problem p02646 (python)

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if b > a:
    if a < 0:
        if b < 0:
            ab = -a - -b
        else:
            ab = -a + b
    else:
        ab = b - a
else:
    if b < 0:
        if a < 0:
            ab = -b - -a
        else:
            ab = -b + a
    else:
        ab = a - b


vt = v * t
wt = w * t



if vt - wt >= ab:
    print("YES")
else:
    print("NO")

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

if b > a:
    if a < 0:
        if b < 0:
            ab = -b - -a
        else:
            ab = -a + b
    else:
        ab = b - a
else:
    if b < 0:
        if q < 0:
            ab = -a - -b
        else:
            ab = -b + a
    else:
        ab = a - b


vt = v * t
wt = w * t



if vt - wt >= ab:
    print("YES")
else:
    print("NO")
Problem p02741 (python)

Fixed submission:
x = int(input())
y = 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
print(y[x-1])

Buggy submission (verdict: Runtime Error):
x = int(input())
x_list = 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
print(y[x])
Problem p02755 (python)

Fixed submission:
A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    Y = int(B_price) / 100 * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
import decimal
decimal.getcontext().prec = 4
A, B = map(int, input().split())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
import decimal
decimal.getcontext().prec = 4
A, B = map(int, input().slit())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().slit())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    if B == int(X):
    	print(A_price)
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100

if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    if B == X:
    	print(A_price)
    else:
    	print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100


if int(A_price) == int(B_price):
  print(int(A_price))
else:
  print(-1)

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

A_price = A // 8 * 100

B_price = B // 10 * 100

if A_price == B_price:
  print(A_price)
else:
  print(-1)
Problem p02573 (python)

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


root = list(range(n + 1))


# from collections import defaultdict
# d = defaultdict(set)
cnt = [1] * (n + 1)


def find(i):
    if i == root[i]:
        return i
    root[i] = find(root[i])
    return root[i]

def union(u, v):
    fu, fv = find(u), find(v)
    if fu == fv:
        return
    cnt[min(fu, fv)] += cnt[max(fu, fv)]
    root[max(fu, fv)] = min(fu, fv)



for i in range(m):
    u, v = map(int, input().split())
    union(u, v)



# print(d)
print(max(cnt))

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


root = list(range(n + 1))


from collections import defaultdict
d = defaultdict(set)



def find(i):
    if i == root[i]:
        return i
    root[i] = find(root[i])
    return root[i]

def union(u, v):
    fu, fv = find(u), find(v)
    if fu == fv:
        d[min(fu, fv)].add(max(u, v))
        return
    root[max(u, v)] = min(fu, fv)
    # root[u] = fv
    d[min(fu, fv)].add(max(u, v))



for i in range(m):
    u, v = map(int, input().split())
    union(u, v)



# print(d)
print(max(map(len, d.values())) + 1)

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


root = list(range(n + 1))


from collections import Counter
d = Counter()



def find(i):
    if i == root[i]:
        return i
    root[i] = find(root[i])
    return root[i]

def union(u, v):
    fu, fv = find(u), find(v)
    if fu == fv:
        return
    root[max(u, v)] = min(fu, fv)
    # root[u] = fv
    d[min(fu, fv)] += 1



for i in range(m):
    u, v = map(int, input().split())
    union(u, v)



# print(d)
print(max(d.values()) + 1)
Problem p02717 (python)

Fixed submission:
[A, B, C] = list(map(str, input().split(' ')))

print(C + ' ' + A + ' ' + B)

Buggy submission (verdict: Runtime Error):
[A, B, C] = list(map(int, input().split(' ')))

print(C + ' ' + A + ' ' + B)
Problem p02718 (python)

Fixed submission:
[N, M] = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))
A = sorted(A, reverse=True)

if(A[M-1] < (sum(A) * 1 / (4 * M))):
    print('No')
else:
    print('Yes')

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

if(A[M] < (1 / 4 *sum(A))):
    print('No')
else:
    print('Yes')
Problem p02921 (python)

Fixed submission:
s,d = map(str, open(0).read().split())
ss = list(s)
dd = list(d)
a = 0
for i in range(len(ss)):
  if(ss[i] == dd[i]):
    a += 1
    
print(a)

Buggy submission (verdict: Runtime Error):
s,d = map(str, open(0).read().split())
ss = list(s)
dd = list(d)
a = 0
for i in range(ss):
  if(ss[i] == dd[i]):
    a += 1
    
print(a)
Problem p02945 (python)

Fixed submission:
values = list(map(int, input().split(' ')))
AplusB = values[0] + values[1]
AminusB = values[0] - values[1]
AtimesB = values[0] * values[1]
print(max([AplusB, AminusB, AtimesB]))

Buggy submission (verdict: Runtime Error):
values = map(int, input().split())
AplusB = values[0] + values[1]
AminusB = values[0] - values[1]
AtimesB = values[0] * values[1]
print(max([AplusB, AminusB, AtimesB]))
Problem p03244 (python)

Fixed submission:
from collections import defaultdict

n = int(input())
v = list(map(int, input().split(' ')))

odd = defaultdict(int)
even = defaultdict(int)
al = defaultdict(int)

for i in range(len(v)):
  al[v[i]] += 1
  if(i % 2 == 0): # even
    even[v[i]] += 1
  else: # odd
    odd[v[i]] += 1

if(len(al) == 1):
  print(n // 2)
  exit()

even_sorted = sorted(even.items(), key=lambda x: x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x: x[1], reverse=True)

#print(even_sorted[0:4])
#print(odd_sorted[0:4])


if(len(even_sorted) == 1): # what if either of them had only one uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - odd_sorted[1][1]  - even_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])
elif(len(odd_sorted) == 1):
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - even_sorted[1][1] - odd_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])


else: # both of them have more than 1 uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    if(odd_sorted[0][1] == even_sorted[0][1]):
      if(odd_sorted[1][1] < even_sorted[1][1]):
        print(n - odd_sorted[0][1] - even_sorted[1][1])
      else:
        print(n - odd_sorted[1][1] - even_sorted[0][1])
    elif(odd_sorted[0][1] < even_sorted[0][1]): # odd to be changed (even stays)
      print(n - odd_sorted[1][1] - even_sorted[0][1])
    else:
      print(n - odd_sorted[0][1] - even_sorted[1][1])
  else: # both has more than 1 uniq num, and most freq values aren't the same
    print(n - odd_sorted[0][1] - even_sorted[0][1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

n = int(input())
v = list(map(int, input().split(' ')))

odd = defaultdict(int)
even = defaultdict(int)
al = defaultdict(int)

for i in range(len(v)):
  al[v[i]] += 1
  if(i % 2 == 0): # even
    even[v[i]] += 1
  else: # odd
    odd[v[i]] += 1

if(len(al) == 1):
  print(int(n / 2))
  exit()

even_sorted = sorted(even.items(), key=lambda x: x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x: x[1], reverse=True)

#print(even_sorted)
#print(odd_sorted)

if(len(even_sorted) == 1): # what if either of them had only one uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - odd_sorted[1][1]  - even_sorted[0][1])
  else:
    print(n - odd_sorted[0][1] - even_sorted[0][1])
elif(len(odd_sorted) == 1):
  if(odd_sorted[0][0] == even_sorted[0][0]):
    print(n - even_sorted[1][1] - odd_sorted[0][1])
  else:
    print(n - odd_sorted[1][1] - even_sorted[0][1])


else: # both of them have more than 1 uniq num..
  if(odd_sorted[0][0] == even_sorted[0][0]):
    if(odd_sorted[0][1] < even_sorted[0][1]): # odd to be changed (even stays)
      print(n - odd_sorted[1][1] - even_sorted[0][1])
    else:
      print(n - odd_sorted[0][1] - even_sorted[1][1])
  else: # both has more than 1 uniq num, and most freq values aren't the same
    print(n - odd_sorted[0][1] - even_sorted[0][1])