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

Fixed submission:
#!/usr/bin/env python3
import fractions
# import numpy as np
import sys


def solve(A: int, B: int):
    ans = (A * B) // fractions.gcd(A, B)
    # print(np.lcm(A, B))
    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import numpy as np
import sys


def solve(A: int, B: int):
    print(np.lcm(A, B))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
import sys

def solve(A: int, B: int):
    lcm = (A * B) // math.gcd(A, B)
    print(lcm)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()
Problem p02912 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
A = [-a for a in A]
A = sorted(A)
heapq.heapify(A)
for _ in range(M):
    ma = heapq.heappop(A)
    ma = -((-ma)//2)
    heapq.heappush(A, ma)
    # print(A, ma)
print(-sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
while M>0:
    d = max(A[0]//A[1], 1)
    A[0] = A[0]//2**d
    M -= d
    A = sorted(A, reverse=True)
    # print(A, M)

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
while M>0:
    d = A[0]//A[1]
    A[0] = A[0]//2**d
    M -= d
    A = sorted(A, reverse=True)
    # print(A, M)

print(sum(A))
Problem p03265 (python)

Fixed submission:
x1, y1, x2, y2 = map(int, input().split())
dis_x = x2 - x1
dis_y = y2 - y1
print(x2-dis_y, y2+dis_x, x1-dis_y, y1+dis_x)

Buggy submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
dis1 = x2 - x1
dis2 = y2 - y1
print('{} {} {} {}').format(x2-dis2, y2+dis1, x1-dis2, y1+dis1)
Problem p02847 (python)

Fixed submission:
S = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
day = input()
#print day till next sunday
print(len(S) - S.index(day))

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

def shifter(n, char):
    if ((ord(char) + n) > ord('Z')):
        n = n - 26
    
    return chr(ord(char) + n)

shifted_s = ''.join([shifter(n, char) for char in list(s)])

print(shifted_s)
Problem p02773 (python)

Fixed submission:
N = int(input())
words = []
for _ in range(N):
    words.append(input())
count_table = {}
for w in words:
    if w in count_table:
        count_table[w] += 1
    else:
        count_table[w] = 0
best_count = 0
best_words = []
for w in count_table:
    if best_count < count_table[w]:
        best_count = count_table[w]
        best_words = [w]
    elif best_count == count_table[w]:
        best_words.append(w)
for w in sorted(best_words):
    print(w)

Buggy submission (verdict: Runtime Error):
N = int(input())
words = []
for _ in range(N):
    words.append(input())
count_table = {}
for w in words:
    if w in count_table:
        count_table[w] += 1
    else:
        count_table[w] = 0
best_count = 0
for w in count_table:
    if best_count < count_table[w]:
        best_count = count_table[w]
        best_words = [w]
    elif best_count == count_table[w]:
        best_words.append(w)
for w in sorted(best_words):
    print(w)
Problem p02790 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
if a <= b:
  print(str(a) * b)
else:
  print(str(b) * a)

Buggy submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]
if a <= b:
  return str(a) * b
else:
  return str(b) * a
Problem p03835 (python)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy submission (verdict: Runtime Error):
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    print(x)
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy submission (verdict: Runtime Error):
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    print(x)
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy submission (verdict: Runtime Error):
ks = input()
count = 0
k, s = [int(x) for x in sk.split(" ")]
count = 0
for i in range(min(k+1, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
count = 0
for i in range(min(k+1, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1

Buggy submission (verdict: Runtime Error):
count = 0
for i in range(min(k, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1

Buggy submission (verdict: Runtime Error):
sk = input()
count = 0
for i in range(s + 2):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)
Problem p02829 (python)

Fixed submission:
c = ['1', '2', '3']
a = input()
b = input()
c.remove(a)
c.remove(b)
print(c[0])

Buggy submission (verdict: Runtime Error):
choice = [1, 2, 3]
a = input()
b = input()
choice.remove(a)
choice.remove(b)
print(choice)
Problem p02831 (python)

Fixed submission:

a, b = map(int, input().split())
def gcd(l, m):
    x = min(l, m)
    y = max(l, m)
    if y % x == 0:
        return x
    else:
        while y % x != 0:
            z = y % x
            y = x
            x = z
        else:
            return z

def lcm(s, t):
    ans = s * t // (gcd(s, t))
    return ans

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
def lcm(s, t):
    ans = s * t // (math.gcd(s, t))
    return ans
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
#print(a)print(type(a))print(b)print(type(b))
def lcm(s, t):
    ans = s * t // (math.gcd(s, t))
    return ans
print(lcm(a, b))
Problem p02933 (python)

Fixed submission:
a = input()
s = input()

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

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

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

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

if int(a)=>3200:
    print(s)
else:
    print("red")
~
Problem p02935 (python)

Fixed submission:
N = int(input())
Vs = input().split()

if N == 2:
    print(sum([int(x) for x in Vs])/N)
else:
    lists = [int(x) for x in Vs]
    while N > 1:
        lists.sort()
        x = (lists.pop(0) + lists.pop(0)) / 2
        lists.insert(0, x)
        N -= 1

    print(lists[0])

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

if N == 2:
    print(sum([int(x) for x in Vs])/N)
else:
    lists = [int(x) for x in Vs]
    while N > 1:
        lists.sort()
        x = lists.pop(0) + lists.pop(0)) / 2
        lists.insert(0, x)
        N -= 1

    print(lists[0])
Problem p03135 (python)

Fixed submission:
T, X = map(int, input().split())
print(T/X)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
L = list(map(int, input().split()))
XOR = 0
result = []
for i in range(K+1):
  for LINT in L:
     XOR += i ^ LINT
  result.append(XOR)
print(max(result))

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

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int, input().split()))
nagai = max(L)
Problem p02771 (python)

Fixed submission:
A,B,C=map(int,input().split())
print((A==B and B!=C or A==C and C!=B or B==C and B!=A) and "Yes" or "No")

Buggy submission (verdict: Runtime Error):
n=int(input())
L={}
c=0
for i in range (n):
    s=input()
    if s in L:
        L[s]+=1
    else:
        L.update({s:1})
        c+=1
M=list(L.values())
C=list(L.keys())
b=max(M)
F=[]
for i in range(c):
    if M[i]==b:
        F+=[C[i]]
F.sort()
for i in F:
    print(i)
Problem p02790 (python)

Fixed submission:
a, b = input().split()
aa = ""
bb = ""
for i in range(0, int(b)):
    aa += a
for j in range(0, int(a)):
    bb += b

if (int(a)>int(b)):
    print(bb)
else:
    print(aa)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
sumA = ""
sumB = ""
for i in range(int(b)):
    sumA +=""+str(a)
for i in range(int(a)):
    sumB +=""+str(b)
if(int(sumA)>int(sumB)):
    print(sumA)
elif(int(sumB)>int(sumA)):
    print(sumB)
elif(int(sumA) == int(sumB)):
    print(sumA)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
aa = ""
bb= ""
for i in range(1, int(b)-1):
    aa += a
for j in range(1, int(a)-1):
    bb += b

if (ord(aa)>ord(bb)):
    print(aa)
else:
    print(bb)
Problem p02879 (python)

Fixed submission:
line = [int(i) for i in input().split(" ")]
v1 = line[0]
v2 = line[1]

if 0 < v1 and v1 < 10 and 0 < v2 and v2 < 10 :
  print(str(v1*v2))
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
line = [int(i) for i in input.split()]
v1 = line[0]
v2 = line[1]

if 0 < v1 and v1 < 10 and 0 < v2 and v2 < 10 :
  print(v1*v2)
else:
  print(str(-1))
Problem p02779 (python)

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

X = set(A)
if len(A) == len(X):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
import numpy as np

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

X = np.zeros(10**9, dtype = int)
flg = 'YES'
for a in A:
    if X[a]==1:
        flg = 'NO'
        break
    else:
        X[a] += 1
print(flg)
Problem p02793 (python)

Fixed submission:
from fractions import gcd

Mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))

lm = A[0]
for a in A[1:]:
    lm = lm*a//gcd(lm,a)

ans = 0
for i in range(N):
    ans += lm//A[i]
ans %= Mod

print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

Mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))

m = A[0]
for i in range(1,N):
    lm = lm*A[i] // gcd(lm,A[i])

ans = 0

for i in range(N):
    ans += ( lm//A[i] )
    ans %= Mod

print(ans)
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())

print(1+2+3-A-B)

Buggy submission (verdict: Runtime Error):
N,u,v = map(int,input().split())
u -= 1
v -= 1

du = [0]*N
dv = [0]*N
du[u] = 0
dv[v] = 0
G = [[]]*N

def dfs(v, d, p, dis):
    dis[v] = d
    if G[v] != 0:
        for u in G[v]:
            if( u == p):
                continue
            else:
                dfs( u, d+1, v, dis )

def calcDist(s, dist):
    dfs(s, 0, -1, dist)

for i in range(N-1):
    e1,e2 = map(int, input().split())
    e1 -= 1
    e2 -= 1
    if G[e1] == []:
        G[e1] = [e2]
    else:
        G[e1].append(e2)
    if G[e2] == []:
        G[e2] = [e1]
    else:
        G[e2].append(e1)

if G[u]==[v]:
    ans = 0
else:    

    calcDist(v,dv)
    calcDist(u,du)
    maxD = 0
    for idu,idv in zip(du,dv):
        if idu < idv:
            maxD = max(maxD, idv)       
    ans = maxD-1
    
print(ans)

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

if N%2 == 1:
    ans = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N//=10**i

print(cnt)
Problem p02831 (python)

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

g = fractions.gcd(A,B)
print(int(A*B//g))

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

g = math.gcd(A,B)
print(int(A*B//g))
Problem p02833 (python)

Fixed submission:
N = int(input())

if N%2 == 1:
    cnt = 0
else:
    cnt = 0
    a = 1
    while (5**a)*2<=N:
        cnt += N//((5**a)*2)
        a += 1

print(cnt)

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

if N%2 == 1:
    cnt = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        if N < 10:
            break
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N%=10**i

print(cnt)

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

if N%2 == 1:
    ans = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N/=10**i

print(cnt)
Problem p02847 (python)

Fixed submission:
S = input()
WS = list(['SUN','MON','TUE','WED','THU','FRI','SAT'])

ans = 7 - WS.index(S)
print(ans)

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

i=0
N = 0
if A*(10**9) + B*(10) <= X:
    N=10**9
else:
    while i < 10:
        if A*(10**i) + B*(i+1) > X:
            if i==0:
                N = 0
            else:
                N = (X-B*i)//A
                if N < 10**(i-1):
                    N = 0
            break
        else:
            i += 1

print(N)
Problem p02766 (python)

Fixed submission:
n, k = input().split()
import math
def findNumberOfDigits(n, base):
    dig = (math.floor(math.log(n) /
                      math.log(base)) + 1)
    print(dig)

findNumberOfDigits(int(n), int(k))

Buggy submission (verdict: Runtime Error):
n, k = input().split()
print(int(n, int(k)))
Problem p02836 (python)

Fixed submission:
S = input()
ans = int()
for i in range(len(S)//2):
    if S[i] != S[-(i + 1)]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = int()
for i in range(len(S)//2):
if S[i] != S[-(i + 1)]:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
ans = str()
for i in range(N):
    ans += (S[i])
    ans += (T[i])
print(ans)
Problem p02948 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
X = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x: x[0])
heap = []
ans = 0
j = 0

for i in range(1, M+1): # M - i 日後にするバイトを考える
    while (j < N) and (X[j][0] <= i): # 支払いがi日以内
        heapq.heappush(heap, -X[j][1]) # 候補の追加。最大の値が欲しいためマイナスに
        j += 1
    if len(heap):
        ans += - heapq.heappop(heap) # 候補があるとき、候補から最大値を取り出す
print(ans)

Buggy submission (verdict: Runtime Error):
input = sys.stdin.readline
 
import heapq
N, M = map(int, input().split())
X = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x: x[0])
heap = []
ans = 0
j = 0
 
for i in range(1, M+1): # M - i 日後にするバイトを考える
    while (j < N) and (X[j][0] <= i): # 支払いがi日以内
        heapq.heappush(heap, -X[j][1]) # 候補の追加。最大の値が欲しいためマイナスに
        j += 1
    if len(heap):
        ans += - heapq.heappop(heap) # 候補があるとき、候補から最大値を取り出す
print(ans)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
lg = len(str(N))
cnt = 0
if lg == 6:
    cnt = 90909
elif lg == 5:
    cnt += N - 10000 + 1
    cnt += 909
elif lg == 4:
    cnt = 909
elif lg == 3:
    cnt += N - 100 + 1
    cnt += 9
elif lg == 2:
    cnt = 9
else:
    cnt = N
print(cnt)
Problem p02766 (python)

Fixed submission:
import math

N, R = map(int, input().split())
X = math.log(N + 0.000001, R)
Y = math.ceil(X)

print(Y)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
X = math.log(N + 1, 2)
Y = math.ceil(X)

print(Y)
Problem p02836 (python)

Fixed submission:
string = input()
lengch = len(string)
halfLengch = lengch // 2
startString = list(string[:halfLengch])
endString = list(string[:halfLengch - 1:-1])
countHug = 0
 
for i,j in zip(startString, endString) :
    if i != j :
      countHug += 1
 
print(countHug)

Buggy submission (verdict: Runtime Error):
string = input()
lengch = len(string)
halfLengch = lengch // 2
  startString = list(string[:halfLengch + 1])
endString = list(string[halfLengch + 2::-1])
countHug = 0

for i in startString :
  for j in endString :
    if i != j :
      countHug += 1

print(countHug)
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r ** 2)

Buggy submission (verdict: Runtime Error):
r = input()
print(r ** 2)
Problem p03208 (python)

Fixed submission:
s = input().split(" ")
N = int(s[0])
K = int(s[1])

h = []
for i in range(N) : 
    s = input()
    h.append(int(s))
    
h = sorted(h)
minDiff = h[len(h) - 1] - h[0]
for i in range(N) : 
    try : 
        diff = h[i + K - 1] - h[i]
        minDiff = min(minDiff , diff)
        
    except : 
        if i == 0 : minDiff = 0
        continue
print(minDiff)

Buggy submission (verdict: Runtime Error):
h = []
for i in range(N) : 
    s = input()
    h.append(int(s))
    
h = sorted(h)
minDiff = h[len(h) - 1] - h[0]
for i in range(N) : 
    try : 
        diff = h[len(h) - K + i] - h[i]
        print(f"diff={h[len(h) - K + i]} - {h[i]} = {diff}")
        minDiff = min(minDiff , diff)
        
    except : 
        if i == 0 : minDiff = 0
        continue
print(minDiff)

Buggy submission (verdict: Runtime Error):
h = []
for i in range(N) : 
    s = input()
    h.append(int(s))
    
h = sorted(h)
minDiff = h[len(h) - 1] - h[0]
for i in range(N) : 
    try : 
        diff = h[len(h) - K + i] - h[i]
        print(f"diff={h[len(h) - K + i]} - {h[i]} = {diff}")
        minDiff = min(minDiff , diff)
        
    except : 
        if i == 0 : minDiff = 0
        continue
print(minDiff)

Buggy submission (verdict: Runtime Error):
s = input().split(" ")
N = int(s[0])
K = int(s[1])

h = []
for i in range(N) : 
    s = input()
    h.append(int(s))
    
h = sorted(h)
minDiff = h[len(h) - 1] - h[0]
for i in range(N) : 
    try : 
        diff = h[len(h) - K + i] - h[i]
        print(f"diff={h[len(h) - K + i]} - {h[i]} = {diff}")
        minDiff = min(minDiff , diff)
        
    except : 
        if i == 0 : minDiff = 0
        continue
print(minDiff)
Problem p02773 (python)

Fixed submission:
from collections import Counter
num = int(input())
value = [input() for i in range(num)]
votes = Counter(value)
dict = {}

for value in votes.values():
    dict[value] = []

for (key, value) in votes.items():
    dict[value].append(key)
maxVote = sorted(dict.keys(), reverse=True)[0]
list_data = dict[maxVote]
list_data.sort()
for i in list_data:
    print(i)

Buggy submission (verdict: Runtime Error):
from collections import Counter
num = int(input())
value = [input() for i in range(num)]
votes = Counter(value)
dict = {}

for value in votes.values():
    dict[value] = []

for (key, value) in votes.iteritems():
    dict[value].append(key)
maxVote = sorted(dict.keys(), reverse=True)[0]
if len(dict[maxVote]) > 1:
    print(sorted(dict[maxVote])[0])
else:
    print(dict[maxVote][0])
Problem p02773 (python)

Fixed submission:
import collections

if __name__ == '__main__':
    N = int(input())
    kv = collections.defaultdict(int)
    max_cnt = 0
    res = []
    for _ in range(N):
        word = input()
        kv[word] += 1
        if kv[word] == max_cnt:
            res.append(word)
        elif kv[word] > max_cnt:
            res = [word]
            max_cnt = kv[word]
    for s in sorted(res):
        print(s)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    kv = collections.defaultdict(int)
    max_cnt = 0
    res = []
    for _ in range(N):
        word = input()
        kv[word] += 1
        if kv[word] == max_cnt:
            res.append(word)
        elif kv[word] > max_cnt:
            res = [word]
            max_cnt = kv[word]
    print('\n'.join(sorted(res)))
Problem p02771 (python)

Fixed submission:
import sys
li = list(map(int,input().split()))
li.sort()
if(str(li[0]) == str(li[1]) == str(li[2])):
  print("No")
  sys.exit()
if(str(li[0]) != str(li[1]) != str(li[2])):
  print("No")
  sys.exit()
for i in range(3):
  if(str(li[i]) == str(li[i+1])):
    print("Yes")
    break

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
li=[input() for _ in range(n)]
c = collections.Counter(li)
max_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_list.sort()
for s in max_list:
  print(s)

Buggy submission (verdict: Runtime Error):
import sys
import collections
n = int(input())
li=[input() for _ in range(n)]
c = collections.Counter(li)
max_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_list.sort()
for s in max_list:
  print(s)

Buggy submission (verdict: Runtime Error):
import sys
li = list(map(int,input().split()))
li.sort()
if(str(li[0]) == str(li[1]) == str(li[2])):
    print("No")
    sys.exit()
for i in range(3):
  if(str(li[i]) == str(li[i+1])):
    print("Yes")
    break
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys
li = list(map(int,input().split()))
li.sort()
for i in range(3):
  if(str(li[i]) == str(li[i+1]) == str(li[i+2])):
    print("No")
    sys.exit()
  if(str(li[i]) == str(li[i+1])):
    print("Yes")
    break
else:
  print("No")
Problem p02777 (python)

Fixed submission:
s, t = map(str,input().split())	
a, b = map(int,input().split())	
u = input()
if(s == u):
  a -= 1;
elif(t == u):
  b -= 1;
print("{} {}".format(a, b))

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int,input().split()))
'''
for num in a:
  i = a.index(num)
  if(num in a[i+1:]):
    print("NO")
    sys.exit()
print("YES")
'''

i=0
while(i<n):
  if(a[i] in a[i+1:]):
    print("NO")
    sys.exit()
  i += 1
print("YES")
Problem p02951 (python)

Fixed submission:
str = input().split(" ")

if int(str[0])-int(str[1]) >= int(str[2]):
    print(0)
else:
    print(int(str[2])-int(str[0])+int(str[1]))

Buggy submission (verdict: Runtime Error):
str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)