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

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

Buggy submission (verdict: Runtime Error):
a = int(input())
s = int(input())
print(s if a < 3200 else "red")

Buggy submission (verdict: Runtime Error):
a = int(input())
s = int(input())
print(s if a >= 3200 else "red")
Problem p02990 (python)

Fixed submission:
from math import factorial
C = lambda y, x: factorial(y) // factorial(x) // factorial(y - x)
mod = 1000000007
def solve():
    n, k = map(int, input().split())
    for i in range(1, k + 1):
        if i <= (n - k) + 1:
            print(C(n - k + 1, i) * C(k - 1, i - 1) % mod)
        else:
            print(0)
solve()

Buggy submission (verdict: Runtime Error):
from math import factorial
C = lambda y, x: factorial(y) // factorial(x) // factorial(y - x)
mod = 1000000007
def solve():
    n, k = map(int, input().split())
    for i in range(1, k + 1):
        print(C(n - k + 1, i) * C(k - 1, i - 1) % mod)
solve()
Problem p03127 (python)

Fixed submission:
from heapq import heapify, heappush, heappop
n = int(input())
A = list(map(int, input().split()))
heapify(A)
while len(A) != 1:
    t = heappop(A)
    A = [a % t for a in A if a % t != 0]
    if A is None:
        A = [t]
        break
    heappush(A, t)
print(A[0])

Buggy submission (verdict: Runtime Error):
from math import gcd
n = int(input())
A = list(map(int, input().split()))
ans = A[0]
for a in A[1:]:
    ans = gcd(ans, a)
print(ans)
Problem p03242 (python)

Fixed submission:
print(input().translate(str.maketrans("19", "91")))

Buggy submission (verdict: Runtime Error):
print(input().tranprint(input().translate(str.maketrans("1", "9"))))slate(str.maketrans("1", "9")))
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
x = N // (A + B)
y = N % (A + B)
if y < A:
    print(x*A + y)
else:
    print(x*A + A)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = []
l_a = ['b' for i in range(A)]
l_b = ['r' for i in range(B)]
for val in range(N // (A + B)):
    l += l_a
    l += l_b
cnt = 0
for val in range(N):
    if l[val] == 'b':
        cnt += 1
print(cnt)
Problem p02771 (python)

Fixed submission:
A = set(map(int, input().split()))
if len(A) == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for val in A:
    if val % 2 == 1:
        continue
    elif val % 2 == 0:
        if val % 3 == 0:
            continue
        elif val % 5 == 0:
            continue
        else:
            print('DENIED')
            break
else:
    print('APPROVED')
Problem p02777 (python)

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

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
    for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
            break
    else:
        continue
    break
if counter == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
    for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
        else:
            continue
if counter == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
counter = 0
for val in range(N - 1):
     for i in range(N - val - 1):
        if A[val] == A[val+i+1]:
            counter += 1
        else:
            break
if counter == 0:
    print('YES')
else:
    print('NO')
Problem p02916 (python)

Fixed submission:

n = int(input())

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

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

c = list(map(int, input().split()))

m = n-1
ans = 0
for i in range(n):
    ans += b[a[i]-1]
    if (i>0)and(a[i] == a[i-1]+1):
        ans += c[a[i-1]-1]

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())

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

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

c = list(map(int, input().split()))

m = n-1
sumc = 0
for i in range(m):
    if a[i+1] == a[i]+1:
        sumc += c[i]
#tmp = a[m]
#if m > 1:
#    if tmp <= m:
#        sumc -= c[tmp-1]
if m == 1:
    if tmp == 1:
        sumc = 0
ans = sum(b)
ans += sumc

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())

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

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

c = list(map(int, input().split()))

m = n-1
sumc = sum(c)
tmp = a[m]
if m > 1:
    sumc -= c[tmp-1]
ans = sum(b)
ans += sumc

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())

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

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

c = list(map(int, input().split()))

m = n-1
if m == 1:
    sumc = sum(c)
else:
    sumc = sum(c)
    tmp = a[m]
    sumc -= c[tmp-1]
ans = sum(b)
ans += sumc

print(ans)
Problem p02729 (python)

Fixed submission:
from math import factorial as f
x,y=map(int,input().split())
if(x<2):
    a=0
else:
    a=f(x)//(f(x-2)*2)
if(y<2):
    b=0
else:    
    b=f(y)//(f(y-2)*2)
print(a+b)

Buggy submission (verdict: Runtime Error):
from math import factorial as f
x,y=map(int,input().split())
a=f(x)//(f(x-2)*2)
b=f(y)//(f(y-2)*2)
print(a+b)
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
an = N // (A+B) * A
rem = N % (A+B)
an += min(rem,A)
print(an)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
an = N // (A+B) * A
rem = N % (A+B)
an += min(rem,A)
print(ans)
Problem p02753 (python)

Fixed submission:
s = input()

ss = set(s)

if len(ss) == 1:
    print('No')
else:
    print('Yes')

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

x = -1

xa = 0
xb = 0

a_arr = []
b_arr = []

for temp_a in range(10001):
    xa = temp_a * 0.08
    if xa // 1 == a:
        a_arr.append(temp_a)

for temp_b in range(10001):
    xb = temp_b * 0.1
    if xb // 1 == b:
        b_arr.append(temp_b)

for aa in a_arr:
    if aa in b_arr:
        print(aa)
        exit(0)

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

Fixed submission:
N=int(input())
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /N
print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /((N-1)/2)
return answer

Buggy submission (verdict: Runtime Error):
N=input()
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /((N-1)/2)
return answer

Buggy submission (verdict: Runtime Error):
N=input()
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /(N-1)/2
print(answer)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=input()
if N%2==0:
  answer = 1.0/2
else:
  answer = ((N-1)/2 + 1) /(N-1)/2
print(answer)
Problem p02777 (python)

Fixed submission:
color = input().split()
 
num = input().split()

stock = {}
stock[color[0]] = num[0]
stock[color[1]] = num[1]
 
u = input().split()
 
stock[u[0]] = int(stock[u[0]]) - 1
 
print('{col1} {col2}'.format(col1=stock[color[0]],col2=stock[color[1]]))

Buggy submission (verdict: Runtime Error):



color = input.split()

num = input.split()

stock[color[0]] = num[0]
stock[color[1]] = num[1]

u = input.split()

stock[u] = stock[u] - 1

print({col1} {col2}).format(col1=stock[color[0]],col2=stock[color[1]])
Problem p02753 (python)

Fixed submission:
S = set(input())
if len(S) == 2:
    print('Yes')
elif len(S) == 1:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
Q = int(input())
for _ in range(Q):
    query = input().split()
    if len(query) == 1:
        S = S[::-1]
        # print('Ti=1: ' + S)
    else:
        F = int(query[1])
        C = query[2]
        if F == 1:
            S = ''.join([C, S])
        elif F == 2:
            S = ''.join([S, C])
        # print('Ti=2: ' + S)

print(S)
Problem p03053 (python)

Fixed submission:
from subprocess import call
call (('pypy3', '-c', """
from collections import deque

def main():
    h, w = map(int, input().split())
    A = [list(input()) for _ in range(h)]
    d = [[10**9] * w for _ in range(h)]
    que = deque([])
    
    for i in range(h):
        for j in range(w):
           if A[i][j] == "#":
               que.append([i, j])
               d[i][j] = 0
           else:
               d[i][j] = 10 ** 9
            
    while que:
        x, y = que.popleft()
        dx = [1, 0, -1, 0]
        dy = [0, 1, 0, -1]
        for i in range(4): 
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx < h and 0 <= ny < w and d[nx][ny] == 10**9:
                d[nx][ny] = d[x][y] + 1
                que.append([nx, ny])
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, d[i][j])
    print(ans)
    
    return
    
main()

"""))

Buggy submission (verdict: Runtime Error):
import collections

h, w = map(int, input().split())
a = [[""]*(w+2)]
for _ in range(h):
    _a = list(input())
    _a.append("")
    _a.insert(0, "")
    a.append(_a)
a.append([""]*(w*2))

visited = [[-float("inf")]*(w+2) for _ in range(h+2)]
init = []
for i in range(h+2):
    for j in range(w+2):
        if a[i][j] == "#":
            init.append([i, j])
            visited[i][j] = 0

q = collections.deque(init)

dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]

while 0 < len(q):
    cy, cx = q.pop()
    for _dx, _dy in zip(dx, dy):
        x = cx + _dx
        y = cy + _dy
        if a[y][x] == "." and visited[y][x] == -float("inf"):
            visited[y][x] = visited[cy][cx] + 1
            q.appendleft([y, x])

ans = -1
for _v in visited:
    ans = max(ans, max(_v))

print(ans)

Buggy submission (verdict: Runtime Error):
import collections

h, w = map(int, input().split())
a = [[""]*(w+2)]
for _ in range(h):
    _a = list(input())
    _a.append("")
    _a.insert(0, "")
    a.append(_a)
a.append([""]*(w*2))

visited = [[-float("inf")]*(w+2) for _ in range(h+2)]
init = []
for i in range(h+2):
    for j in range(w+2):
        if a[i][j] == "#":
            init.append([i, j])
            visited[i][j] = 0

q = collections.deque(init)

dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]

while 0 < len(q):
    cy, cx = q.pop()
    for _dx, _dy in zip(dx, dy):
        x = cx + _dx
        y = cy + _dy
        if a[y][x] == "." and visited[y][x] == -float("inf"):
            visited[y][x] = visited[cy][cx] + 1
            q.appendleft([y, x])

ans = -1
for _v in visited:
    ans = max(ans, max(_v))

print(ans)
Problem p03127 (python)

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

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

m = a[0]
while any(map(lambda x: x%m, a)):
    a = sorted([m] + list(map(lambda x: x-m, a[1:])))
    m = a[0]

print(m)
Problem p03805 (python)

Fixed submission:
n, m = map(int, input().split())
g = {}
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g.setdefault(a, [])
    g[a].append(b)
    g.setdefault(b, [])
    g[b].append(a)

isVisited = [False]*n
isVisited[0] = True

def dfs(v: int) -> int:
    if all(isVisited):
        return 1

    ret = 0

    for i in g[v]:
        if isVisited[i]:
            continue

        isVisited[i] = True
        ret += dfs(i)
        isVisited[i] = False

    return ret

print(dfs(0))

Buggy submission (verdict: Runtime Error):
import itertools

n, m = map(int, input().split())
am = [[False]*m for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    am[a-1][b-1] = True
    am[b-1][a-1] = True

ans = 0
for p in itertools.permutations(list(range(n)), n):
    if p[0] != 0:
        continue

    isok = True
    for i in range(len(p)-1):
        if not am[p[i]][p[i+1]]:
            isok = False
            break

    if isok:
        ans += 1

print(ans)
Problem p02779 (python)

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

A_line.sort()

res = "YES"
for i in range(len(A_line) - 1):
  if A_line[i] == A_line[i + 1]:
    res = "NO"

print(res)

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

A_flags = [0] * pow(10, 8)

for A in A_line:
  A_flags[A-1] += 1

res = 'YES'
for A_flag in A_flags:
  if A_flag >= 2:
    res = 'NO'

print(res)
Problem p02753 (python)

Fixed submission:
s = input()

if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
min_8tax = int((tax[0]) / .08)
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int((tax[1]) / .1)

r = -1

#print(max_8tax, min_8tax)
#print(max_10tax, min_10tax)

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i <= max_8tax:
        r = i
        break

print(r)
Problem p02754 (python)

Fixed submission:
info = [int(n) for n in input().split()]

group = info[1] + info[2]

a = info[0] // group
b = info[0] % group
if b > info[1]:
    b = info[1]


result = a * info[1] + b
print(result)

Buggy submission (verdict: Runtime Error):
info = [int(n) for n in input().split()]

group = info[1] + info[2]

a = info // group
b = info % group
if b > info[1]:
    b = info[1]


result = a * info[1] + b
print(result)
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r*r)

Buggy submission (verdict: Runtime Error):
import sys

r = int(sys.argv[1])

print(r*r, end="")

Buggy submission (verdict: Runtime Error):
import sys

r = int(sys.argv[1])

print(r*r)

Buggy submission (verdict: Runtime Error):
import sys

r = int(sys.argv[1])

print(r*r)
Problem p02829 (python)

Fixed submission:
raw_input1 = input()
raw_input2 = input()

A = int(raw_input1)
B = int(raw_input2)

answers = [1,2,3]

answers.remove(A)
answers.remove(B)


for ans in answers:
    print(ans)

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

l = raw_input.split()
A = int(l[0])
B = int(l[1])

answers = [1,2,3]

answers.remove(A)
answers.remove(B)


for ans in answers:
    print(ans)
Problem p02759 (python)

Fixed submission:
N = int(input())
print( N//2 + N%2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0]), int(line[1]) ]

blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0]), int(line[1]) ]
  
connected = [[] for i in range(nPerson+1)]
  
for i in friends:
  if i[1] not in connected[i[0]]:
    connected[i[0]].append(i[1])
  if i[0] not in connected[i[1]]:
    connected[i[1]].append(i[0])

blocked = [[] for i in range(nPerson+1)]
for i in blocks:
  if i[1] not in blocked[i[0]]:
    blocked[i[0]].append(i[1])
  if i[0] not in blocked[i[1]]:
    blocked[i[1]].append(i[0])
  
for i in range(len(connected)):
  connected[i] = set(connected[i])
for i in range(len(blocked)):
  blocked[i] = set(blocked[i])
  
nCand = [0]*(nPerson+1)

def findCand(target,curPer):
  if visited[curPer] == True :
    return
  visited[curPer] = True
  if curPer not in connected[target] and curPer not in blocked[target]:
    nCand[target] += 1
  for i in connected[curPer]:
    findCand(target,i)

for i in range(1,nPerson+1):
  visited = [False]*(nPerson+1)
  visited[i] = True
  for j in connected[i]:
    findCand(i,j)

res = ""
for i in range(1,nPerson+1):
  res += str(nCand[i]) + " "
  
print(res)
Problem p02763 (python)

Fixed submission:
from collections import defaultdict
import bisect

alphabet="abcdefghijklmnopqrstuvwxyz"

bS = int(input())
S= input()
nQ = int(input())

S = [i for i in S]

query = []
for i in range(nQ):
  query.append(input().split())

locs =defaultdict(list)

for i,char in enumerate(S):
    locs[char].append(i)
    
def countChars(iter,ss,ee):
  nChar = 0
  for i in alphabet:
    if len(locs[i]) == 0:
      pass
    else:
      sptr = bisect.bisect_right(locs[i],ss)
      eptr = bisect.bisect_left(locs[i],ee)
      if sptr == eptr:
        if sptr < 1 or sptr > len(locs[i]):
          continue
        else:
          if locs[i][sptr-1] == ss:
            nChar+=1
      else:
        nChar += 1
  return nChar
    
  
res = []
for iter,iQ in enumerate(query):
  if int(iQ[0]) == 2:
    res.append(str( countChars(iter,int(iQ[1])-1,int(iQ[2])) ))
  if int(iQ[0]) == 1:
    location = int(iQ[1])-1
    curChar  = S[location]
    if curChar != iQ[2]:
      locs[curChar].remove(location) #remove from old
      bisect.insort(locs[iQ[2]],location)
      S[location] = iQ[2]
      
print(" ".join(res))

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

alphabet="abcdefghijklmnopqrstuvwxyz"

bS = int(input())
S= input()
nQ = int(input())

query = []
for i in range(nQ):
  query.append(input().split())

locs =defaultdict(list)

for i,char in enumerate(S):
    locs[char].append(i)
    
def countChars(iter,ss,ee):
  nChar = 0
  for i in alphabet:
    if len(locs[i]) == 0:
      pass
    else:
      sptr = bisect.bisect_right(locs[i],ss)
      eptr = bisect.bisect_left(locs[i],ee)
      if sptr == eptr:
        if sptr < 1 or sptr > len(locs[i]):
          continue
        else:
          if locs[i][sptr-1] == ss:
            nChar+=1
      else:
        nChar += 1
  return nChar
    
  
res = []
for iter,iQ in enumerate(query):
  if int(iQ[0]) == 2:
    res.append(str( countChars(iter,int(iQ[1])-1,int(iQ[2])) ))
  if int(iQ[0]) == 1:
    location = int(iQ[1])-1
    curChar  = S[location]
    if curChar != iQ[2]:
      locs[curChar].remove(location) #remove from old
      bisect.insort(locs[iQ[2]],location)
      
print(" ".join(res))
Problem p03295 (python)

Fixed submission:
N,M = map(int,input().split())
listAB = [list(map(lambda x:int(x),input().split())) for i in range(M)]
# 要素の2番目でソート
listAB.sort(key=lambda x: x[1])
# 最後に切った橋の位置
last = -1
ans = 0
for a,b in listAB:
    # 切った橋より右側に依頼があるか
    if last <= a:
        ans += 1
        # 切った位置はbの位置
        last = b

print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [0 for i in range(M)]
b = [0 for i in range(M)]
for i in range(M):
    A,B = map(int,input().split())
    a[i] = A
    b[i] = B

ans = 0
while 1:
    if len(a) == 0:
        break
    maxVal = max(a)
    if ans == 0:
        maxVal = maxVal // 2
    maxIdx = a.index(maxVal)

    for j in reversed(range(len(a))):
        if a[j] <= maxVal <= b[j] - 1:
            a.pop(j)
            b.pop(j)

    ans += 1

print(ans)
Problem p02819 (python)

Fixed submission:
import math
X = int(input())
if X ==2:
    print(2)
else:
    s = 0
    for i in range(X,10**7):
        for j in range(2,math.ceil(i ** 0.5)+1):
            if i % j ==0:
                s += 1
        if s == 0:
            print(i)
            break
        else:
            s = 0

Buggy submission (verdict: Runtime Error):
X = int(input())
from sympy import nextprime
print(nextprime(X))
Problem p02729 (python)

Fixed submission:
f=[1]
for i in range(1,101):
    f.append(i*f[i-1])

n,m=map(int,input().split())
sum=0
if m>=2:
    sum+=(f[m]//(f[2]*f[m-2]))
if n>=2:
    sum+=(f[n]//(f[n-2]*f[2]))
print(sum)

Buggy submission (verdict: Runtime Error):
f=[1]
for i in range(1,100):
    f.append(i*f[i-1])

n,m=map(int,input().split())
sum=0
if m>=2:
    sum+=(f[m]//(f[2]*f[m-2]))
if n>=2:
    sum+=(f[n]//(f[n-2]*f[2]))
print(sum)
Problem p02771 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == b and a == c:
    print("No")
elif a != b and a != c and b != c:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]

d = {}
for i in range(n):
    if s[i] in d:
        d[s[i]] += 1
    else:
        d[s[i]] = 1

ma = [m[0] for m in d.items() if m[1] == max(d.values())]
print(*sorted(ma))
Problem p02777 (python)

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a - 1, b)
else:
    print(a, b - 1)

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

maxexp = 0
for i in range(n-k+1):
    kdice = [float((1+p[i+j])/2) for j in range(k)]
    sumkdice = sum(kdice)
    if sumkdice > maxexp:
        maxexp = sumkdice

print(maxexp)
Problem p02766 (python)

Fixed submission:
########関数部分##############
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
############################
 
#####関数をつかってみる．#####
######今回は二進数に変換######

n, k = map(int, input().split())
n = Base_10_to_n(n, k)
print(len(n))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
ans = []
while n!=0 :
    ans.append(n % x)
    n = n // x
print(len(ans))
Problem p02773 (python)

Fixed submission:
n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in anslist :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

Buggy submission (verdict: Runtime Error):
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in range(len(anslist)) :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])
Problem p02729 (python)

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

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