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

Fixed submission:
a,b,c = [int(x) for x in input().split()]
if (a == b and b!=c) or (a==c and a!=b) or (b==c and b!=a):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
input()
a = [int(x) for x in input().split()]
    
for i in a:
  B = i%2
  if B==0:
    if i%3 == i%5 and i>=6:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input())
b = []
for i in range(N):
  a = int(input())
  b.append(a)
    
for i in b:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input()) #1行目のNを取得する
A = [int(input()) for i in range(N)] #複数行の数値の入力を取得
    
for i in A:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")
Problem p03107 (python)

Fixed submission:
str = list(input())
one = str.count("1")
zero = str.count("0")

print(min(one, zero)*2)

Buggy submission (verdict: Runtime Error):
str = list(input())
last = str[0]
check = 0
ans = 0

while True:
    check = 0
    last = str[0]
    for j in range(len(str) - 1):
        if j >= len(str):
            break

        if last != str[j + 1 - check]:
            str.pop(j-check)
            str.pop(j-check)
            check += 1
            ans += 2

        if str == []:
            break
        last = str[j + 1 - check]

    if check == 0:
        break
    if str == []:
        break

print(ans)
Problem p03127 (python)

Fixed submission:
def main():
    n=int(input())  #数値入力
    a=list(map(int, input().split()))  #リスト入力（数値)
    num = a[0]

    for i in range(n-1):
        num = gcd(num, a[i+1])
    print(num)

# 最大公約数
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

main()

Buggy submission (verdict: Runtime Error):
import functools
import math

n=int(input())  #数値入力
a=list(map(int, input().split()))  #リスト入力（数値)

gcd = functools.reduce(math.gcd, a)
print(gcd)
Problem p02771 (python)

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

if A == B == C:
  print("No")
elif A !=B and A != C and B != C:
  print("No")
else:
  print("Yes")

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

if A == B == C:
  print("No")
else:
  print("Yes")
Problem p02970 (python)

Fixed submission:
n, d = map(int, input().split())
if n % (2*d + 1) == 0:
  print(n // (2*d + 1))
else:
  print(n // (2*d + 1) + 1)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
i = (n // 2*r) + 1
print(i)
Problem p02987 (python)

Fixed submission:
S = list(input())
count = list(S.count(i) for i in set(S))
if len(count) == 2 and count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = list(input())
count = list(S.count(i) for i in set(S))
if count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = list(input())
ans = 'Yes'
count = list(S.count(i) for i in set(S))
if count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')
Problem p03272 (python)

Fixed submission:
N, i = map(int, input().split())
print(N - i + 1)

Buggy submission (verdict: Runtime Error):
N, i = map(int, input().split())
print(N - i +　1)
Problem p03803 (python)

Fixed submission:
a, b = (int(x) for x in input().split())
if a == b:
  print('Draw')
elif a == 1:
  print('Alice')
elif b == 1:
  print('Bob')
elif a > b:
  print('Alice')
elif a < b:
  print('Bob')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(input()) for i in range(N)]
B = [list(input()) for i in range(M)]
ans = 'No'
for i in range(N - M +1):
    for j in range(N - M +1):
        count = 0
        for row in range(M):
            for col in range(M):
                if B[row][col] == A[i + row][j + col]:
                    count += 1
        if count == M * M:
            ans = 'Yes'

print(ans)
Problem p02771 (python)

Fixed submission:
x,y,z = map(int, input().split())

if (x == y and y != z) or (x==z and y !=z) or (x !=y and y==z):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x,y,z = map(int, input().split())

if (x == y and y != z) or (x==z and y !=z) or (a !=b and b==c):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x,y,z = map(int, input().split())

if (x == y and y != z) or (x==z and y !=z) or (a !=b and b==c)
  print("Yes")
else:
  print("No")
Problem p02771 (python)

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

if (a==b and a!=c) or (a==c and a!=b) or (b==c and b!=a):
    print('Yes')
else:
    print('No')

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

if (a==b && a!=c) || (a==c&&a!=b) ||(b==c&&b!=a):
    print('Yes')
else:
    print('No')

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

if (a==b && a!=c) || (a==c&&a!=b) ||(b==c&&b!=a):
    print('yes')
else:
    print('no')
Problem p02773 (python)

Fixed submission:
N = int(input())

strs = []
dicts = {}
for i in range(N):
    s = input()
    if dicts.get(s) is not None:
        dicts[s] += 1
    else:
        dicts[s] = 1

dict_sorted = sorted(dicts.items(), key=lambda x:x[1], reverse=True)

i = 0
sts = []
for s in dict_sorted:
    if dicts[s[0]] == dicts[dict_sorted[0][0]]:
        sts.append(s[0])
    i = dicts[s[0]]

for s in sorted(sts):
    print(s)

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

strs = []
dicts = {}
for i in range(N):
    s = input()
    if dicts.get(s) is not None:
        dicts[s] += 1
    else:
        dicts[s] = 1

dict_sorted = sorted(dict.items(), key=lambda x:x[1])

i = 0
for s in dict_sorted.key():
    if dicts[s] >= i:
        print(s)
    i = dicts[s]
Problem p02771 (python)

Fixed submission:
#coding: utf-8
import numpy as np

A,B,C = raw_input().split()
if((A==B and A!=C) or (A==C and A!=B )or (A!=B and B==C)):
    print ("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#coding: utf-8
import numpy as np

A = input()
B = input()
C = input()
if((A==B and A!=C) or (A==C and A!=B )or (A!=B and B==C)):
    print ("Yes")
else:
    print("No")
Problem p03242 (python)

Fixed submission:
n=input()
n=list(n)
if n[0]=='1':
    n[0]='9'
elif n[0]=='9':
    n[0]='1'
if n[1]=='1':
    n[1]='9'
elif n[1]=='9':
    n[1]='1'
if n[2]=='1':
    n[2]='9'
elif n[2]=='9':
    n[2]='1'
ans=int("".join(n))
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
v=input().split()
#vin=[int(i) for i in v]
nlis=list(n)
nint=int(n)
part_num=int((nint/2))
ev_num=[]
for i in range(part_num):
    ev = 2*i
    ev_num.extend(v[ev])
count_ev=[]
for i in range(part_num):
    count=0
    count_ev.append(ev_num.count(ev_num[i]))
    
ans_ev=min(count_ev)

od_num=[]
for i in range(part_num):
    od = (2*i) + 1
    od_num.extend(v[od])
count_od=[]
for i in range(part_num):
    count=0
    count_od.append(od_num.count(od_num[i]))
ans_od=min(count_od)

if v.count(v[0]) == len(v):
    ans=part_num
else:
    ans=ans_ev+ans_od
print(ans)
Problem p02771 (python)

Fixed submission:
import sys
 
line = [l for l in sys.stdin][0]
digits = line.split(' ')
num = [int(s) for s in digits]
 
res = 'No'
if num[0] == num[1]:
  if num[0] != num[2]:
    res = 'Yes'
    
if num[1] == num[2]:
  if num[1] != num[0]:
    res = 'Yes'

if num[2] == num[0]:
  if num[2] != num[1]:
    res = 'Yes'
    
print(res)

Buggy submission (verdict: Runtime Error):
import sys

line = sys.argv[1]
digits = line.split(' ')
nums = [int(s) for s in digits]

res = 'No'
if num[0] == num[1]:
  if num[0] != num[2]:
    res = 'Yes'
    
if num[1] == num[2]:
  if num[1] != num[0]:
    res = 'Yes'
    
if num[2] == num[0]:
  if num[2] != num[1]:
    res = 'Yes'
return res
Problem p02771 (python)

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

if a==b and b==c and c==a:
  print('No')
elif a!=b and b!=c and c!=a:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c=input(map(int,split()))
if a==b and b==c and c==a:
  print('No')
elif a!=b and b!=c and c!=a:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c=input(map(int,split()))
if a==b==c:
  print('No')
elif a!=b and b!=c and c!=a:
  print('No')
else:
  print('Yes')
Problem p02773 (python)

Fixed submission:
N = int(input())
D = {}
for _ in range(N):
    S = input()
    if S not in D: D[S]=0
    D[S]+=1

M = max(D.values())
for S in sorted(list(D)):
    if D[S]==M:
      print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
li=map(string,input().split())
dic={}
for k in li:
  dic[k]+=1
max_dic= max(dic)
print(max_dic)
Problem p02771 (python)

Fixed submission:
a=input().split(" ")
a1,a2,a3=int(a[0]),int(a[1]),int(a[2])
ans="No"
if a1!=a2 and (a1==a3 or a2==a3):
  ans="Yes"
if a1!=a3 and (a1==a2 or a2==a3):
  ans="Yes"
if a2!=a3 and (a1==a2 or a1==a3):
  ans="Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input().split(" "))
a1,a2,a3=int(a[0]),int(a[1]),int(a[2])
ans="No"
if a1!=a2 and (a1==a3 or a2==a3):
  ans="Yes"
if a1!=a3 and (a1==a2 or a2==a3):
  ans="Yes"
if a2!=a3 and (a1==a2 or a1==a3):
  ans="Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input().split(" "))
a1,a2,a3=int(a[0]),(a[1]),int(a[2])
ans="No"
if a1!=a2 and (a1==a3 or a2==a3):
  ans="Yes"
if a1!=a3 and (a1==a2 or a2==a3):
  ans="Yes"
if a2!=a3 and (a1==a2 or a1==a3):
  ans="Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input().split(" "))
a1,a2,a3=int(a[0]),(a[1]),int(a[2])
ans="No"
if a1!=a2 and (a1==a3 or a2==a3):
  ans="Yes"
if a1!=a3 and (a1==a2 or a2==a3):
  ans="Yes"
if a2!=a3 and (a1==a2 or a1==a3):
  ans="Yes"
Problem p02836 (python)

Fixed submission:
s=list(input())
count=0
for i in range(len(s)//2):
    if s[i]!=s[-i-1]:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
s=list(input())
count=0
if len(s)%2==0:
    for i in range(1,(len(s)//2)+1):
        if s[i-1]!=s[-i]:
            count+=1
else:
    for i in range(1,(len(s)//2))
        if s[i-1]!=s[-i]:
            count+=1
print(count)
Problem p02916 (python)

Fixed submission:
N=int(input())
listA=list(map(int,input().split()))
listB=list(map(int,input().split()))
listC=list(map(int,input().split()))
sumB=int(sum(listB))
for i in range(1,N):
    if listA[i] == listA[i-1]+1:
        sumB=sumB+int(listC[listA[i-1]-1])
print(sumB)

Buggy submission (verdict: Runtime Error):
N=int(input())
listA=list(map(int,input().split()))
listB=list(map(int,input().split()))
listC=list(map(int,input().split()))
sumB=int(sum(listB))
for i in range(1,N-1):
    if listA[i] == listA[i-1]+1:
        sumB=sumB+int(listC[listA[i-2]])
print(sumB)

Buggy submission (verdict: Runtime Error):
N=int(input())
listA=list(map(int,input().split()))
listB=list(map(int,input().split()))
listC=list(map(int,input().split()))
sumB=int(sum(listB))
for i in range(1,N-1):
    if listA[i] == listA[i-1]+1:
        sumB=sumB+int(listC[listA[i-2]])
print(sumB)

Buggy submission (verdict: Runtime Error):
N=int(input())
listA=list(map(int,input().split()))
listB=list(map(int,input().split()))
listC=list(map(int,input().split()))
sumB=int(sum(listB))
print("sumB",sumB)
for i in range(1,N-1):
    if listA[i] == listA[i-1]+1:
        sumB=sumB+int(listC[listA[i-2]])
print(sumB)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
list=list(map(int,input().split()))
np_list=np.array(list)
inv_np_list=1/np_list
print(1/(sum(inv_np_list)))
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
N=input()
Num = len(N)
if Num == 5:
		Ans = (int(N)-9999) + 900 + 9
elif Num == 4:
		Ans = 900 + 9
elif Num == 3:
		Ans = (int(N)-99) + 9
elif Num == 2:
		Ans = 9
elif Num == 1:
		Ans = N
elif Num == 6:
		Ans = 90000 + 900 + 9    
print(Ans)
Problem p02989 (python)

Fixed submission:
n=int(input())
dlis=sorted(list(map(int,input().split())))
print(dlis[int((n/2))]-dlis[int(n/2)-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
dlis=sorted(list(map(int,input().split())))
print(dlis[int((n/2)+2)]-dlis[int(n/2)+1])
Problem p02990 (python)

Fixed submission:
import math
n,k = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(1,k+1):
    blue = combinations_count(k-1,i-1)
    if n-k+1<i:
        red = 0
    else:
        red = combinations_count(n-k+1,i)
    print(blue*red%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(1,k+1):
    blue = combinations_count(k-1,i-1)
    red = combinations_count(n-k+1,i)
    print(blue*red%(10**9+7))
Problem p03011 (python)

Fixed submission:
x= list(map(int,input().split()))
print(sum(x)-max(x))

Buggy submission (verdict: Runtime Error):
p,q,r = map(int,input().split())
print(sum(p,q,r)-max(p,q,r))
Problem p03077 (python)

Fixed submission:
import math
n = int(input())
s = [int(input()) for i in range(5)]
print(math.ceil(n/min(s))+4)

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

Fixed submission:
N,i=map(int,input().split())
print(N-i+1)

Buggy submission (verdict: Runtime Error):
N,i=map(int,input(),split())
print(N-i+1)
Problem p03803 (python)

Fixed submission:
a,b = map(int,input().split())
x = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if x.index(a)>x.index(b):
    print("Alice")
elif x.index(a)==x.index(b):
    print("Draw")
else:
    print("Bob")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
x = [2,3,4,5,6,7,8,9,10,11,12,1]
if x.index(a)>x.index(b):
    print("Alice")
elif x.index(a)==x.index(b):
    print("Draw")
else:
    print("Bob")
Problem p02771 (python)

Fixed submission:
hoge = input().split()
 
aaa = 0  
if hoge[0] == hoge[1]:
  aaa += 1
if hoge[0] == hoge[2]:
  aaa += 1
if hoge[1] == hoge[2]:
  aaa += 1    
 
if (aaa == 1) or (aaa == 2):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
hoge = input().split()
 
aaa = 0  
if hoge[0] == hoge[1]:
  aaa += 1
if hoge[0] == hoge[2]:
  aaa += 1
if hoge[1] == hoge[2]:
  aaa += 1    

if aaa = 1:
  print("Yes")
else:
  print("No")
Problem p02835 (python)

Fixed submission:
A1, A2, A3 = map(int,input().split())

if A1 + A2 + A3 >= 22:
    print("bust")
else :
    print("win")

Buggy submission (verdict: Runtime Error):
A1, A2, A3 = input().split()

if A1 + A2 + A3 >= 22:
    print("bust")
else :
    print("win")
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int,input().split())
 
PQ = P + Q
QR = Q + R
RP = R + P

temp1 = min(PQ, QR)
temp2 = min(temp1, RP)

print(temp2)

Buggy submission (verdict: Runtime Error):
P, Q, R = map(int,input().split())
 
PQ = P + Q
QR = Q + R
RP = R + Q

temp1 = min(PQ, QR)
temp2 = min(temp2, RP)

print(temp2)
Problem p03075 (python)

Fixed submission:
A = [int(input()) for _ in range(5)]
K = int(input())

lenge = 0

for i in range(5):
  for j in range(5):
    if A[i] - A[j] > K:
      lenge += 1
      
if lenge > 0:
  print(":(")
else :
  print("Yay!")

Buggy submission (verdict: Runtime Error):
A = [int(input()) for i in range(5)]
K = input()

lenge = 0

for i in range(A):
  for j in range(A):
    if A[i] - A[j] > K:
      lenge += 1
      
if lenge == 0:
  print(":(")
else :
  print("Yay!")

Buggy submission (verdict: Runtime Error):
A = [int(input()) for i in range(5)]
K = input()

lenge = 0

for i in range(A):
  for j in range(A):
    if A[i] - A[j] > K:
      s += 1
      
if s == 0:
  print(":(")
else :
  print("Yay!")
Problem p03327 (python)

Fixed submission:
A = int(input())

if A >= 1000:
  print("ABD")
else:
  print("ABC")

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

if A >= 1000:
  print("ABD")
else:
  print("ABC")
Problem p03315 (python)

Fixed submission:
print(4 - 2 * input().count('-'))

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>

using namespace std;
char a[15];
int main(){
    scanf("%s", a);
    int lsum = 0, sum = 0;
    for(int i = 0; i < strlen(a); i++){
        lsum += a[i] - '0';
        sum   = sum * 10 + a[i] - '0';
    }
    if(sum % lsum == 0) printf("Yes\n");
    else printf("No\n");
}
Problem p02771 (python)

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

if A==B and B==C and A==C:
    print("No")

elif A!=B and B!=C and A!=C:
    print("No")

else :
    print("Yes")

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

if A==B && B==C && A==C:
    print("No")

elif A!=B && B!=C && A!=C:
    print("No")

else :
    print("Yes")
Problem p02912 (python)

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

a = list(map(lambda x: -int(x), input().split()))
heapq.heapify(a)

for i in range(m):
    heapq.heappush(a, int(heapq.heappop(a)/2))

print(-sum(a))

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

a = list(map(lambda x: -int(x), input().split()))
heapq.heapqify(a)

for i in range(m):
    heapq.heappush(a, int(heapq.heappop(a)/2))

print(-sum(a))
Problem p02773 (python)

Fixed submission:
N = int(input())

hash = {}
for i in range(N):
	key = input()
	if key in hash:
		hash[key] += 1
	else:
		hash[key] = 1
        
max = 0
results = []
for i, v in hash.items():
	if max == v:
		results.append(i)
	elif max < v:
		results = [i]
		max = v

results.sort()
for i in results:
	print(i)

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

hash = {}
for i in range(N):
	key = input()
	if key in hash:
		hash[key] += 1
	else:
		hash[key] = 1
        
max = 0
results = []
for i, v in hash.items():
	if max == v:
		results.append(v)
	elif max < v::
		results = [v]
        
for i in results:
	print(v)
Problem p02835 (python)

Fixed submission:
a = input().split()
a2 = 0
for i in range(len(a)):
    a2 += int(a[i])
#print(a2)
if a2 >= 22:
    print('bust')
elif a2 <= 21:
    print('win')

Buggy submission (verdict: Runtime Error):
a = input().split()
a2 = 0
for i in range(len(a)):
    a2 += int(a[i])
print(a2)
if a2 >= bust:
    print('win')
elif a2 <= 21:
    print('win')
Problem p02773 (python)

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]
S.sort()

ans = []
counter = 1
memo = 0

for i in range(1, N):
    if S[i] == S[i-1]:
        counter += 1
    else:
        if counter == memo:
            ans.append(S[i-1])
        elif counter > memo:
            ans.clear()
            ans.append(S[i-1])
            memo = counter
        counter = 1
if counter == memo:
    ans.append(S[N-1])
elif counter > memo:
    ans.clear()
    ans.append(S[N-1])
    memo = counter
for a in ans:
    print(a)

Buggy submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
S = [input() for _ in range(N)]
# print(S)

c = collections.Counter(S)
# print(c.most_common())

outputs = []
for i, (key, value) in enumerate(c.most_common()):
    outputs.append(key)
    if not (i == len(c.most_common())-1 and c.most_common()[i+1][1] == value):
        break
for x in reversed(outputs):
    print(x)
Problem p02771 (python)

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

Buggy submission (verdict: Runtime Error):
l = [*map(int, input().split())]
l.sort()
if l[0] != l[2] and (l[0] == l[1] or l[1] == l[2]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = [*map(int, input().split())]
l.sort()
if l[0] == l[1] and l[0] != l[2]:
    print("YES")
elif l[0] == l[2] and l[0] != l[1]:
    print("YES")
else:
    print("NO")
Problem p02835 (python)

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

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split())
if sum(a)>=22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split())
if sum(a)>=22:
    print(bust)
else:
    print(win)
Problem p02773 (python)

Fixed submission:
from collections import Counter
N = int(input())
S = Counter(input() for _ in range(N))
m = max(S.values())
for v in sorted(k for k, v in S.items() if v == m):
	print(v)

Buggy submission (verdict: Runtime Error):

num = input()
l = []
for i in range(0,int(num)):
    l.append(input())

cnt = []
l_t = list(set(l))
for item in l_t:
    cnt.append(l.count(item))

num_dict = dict(zip(l_t),cnt))
max_v = max(num_dict.values())

keys = []

for word, num in num_dict.items():
    if num == max_v:
        keys.append(word)

for i in sorted(keys):
    print(i)
Problem p02771 (python)

Fixed submission:
a, b, c  = (int(x) for x in input().split())
 
if a == b == c:
  print('No')
elif a != b and a != c and b != c:
  print('No')
else:
  print('Yes')

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

if a == b == c:
  print('No')
elif a != b and a != c and b != c:
  print('No')
else:
  print('Yes')

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

if a == b == c:
  print('No')
elif a != b and a != c and b != c:
  print('No')
else:
  print('Yes')
Problem p02777 (python)

Fixed submission:
s, t = map(str, input().split())

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

u = input()

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
 
p = [(e+1) / 2 for e in p]
 
s = sum(p[0:k])
s_max = s
 
for i in range(n-k):
  s = s - p[i] + p[i+k]
  if s_max < s:
    s_max = s
    
print(s_max)
Problem p03307 (python)

Fixed submission:
n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2*n)

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

if n % 2 == 0:
  print(n)
else:
  print(2*n
Problem p02831 (python)

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

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

Fixed submission:
a = set(map(lambda x: int(x), input().split()))

if(len(a) == 2):
    print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
import bisect
 
 
n, k = map(lambda x: int(x), input().split())
a = list(map(lambda x: int(x), input().split()))
 
a.sort()
pos = bisect.bisect(a, 0)
 
def judge(cur):
    global n, k, a
    cnt, j = 0, 1
    for i in range(pos):
        while(j < len(a) and (i == j or a[i] * a[j] > cur)): j += 1
        if(j >= len(a)): break
        cnt += (len(a) - j)
 
    j = len(a) - 1
    for i in range(pos, len(a)):
        while(j > i and (i == j or a[i] * a[j] > cur)): j -= 1
        if(i >= j): break
        cnt += (j-i)
 
    if(cnt >= k): return True
    else: return False
 
 
l, r = int(-1e18), int(1e18)
while(l < r):
    m = (l+r)>>1
    if(judge(m)): r = m
    else: l = m + 1

if(judge(r) == False): r -= 1
print(r)
Problem p02773 (python)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
s = Counter(s)
m = max(s.values())

a = []
for d in s.items():
    if d[1] == m:
        a.append(d[0])
for s in sorted(a):
    print(s)

Buggy submission (verdict: Runtime Error):
import collections
n = input()
s = [input() for _ in range(n)]
s = collections.Counter(s)
m = max(s.values())

a = []
for d in s.items():
    if d[1] == m:
        a.append(d[0])
for s in a:
    print(s)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = input()
s = [input() for _ in range(n)]
s = Counter(s)
m = max(s.values())

a = []
for d in s.items():
    if d[1] == m:
        a.append(d[0])
for s in a:
    print(s)