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

Fixed submission:
from fractions import gcd


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = gcd(a, b)
if g == 1:
    print('1')
else:
    print(len(factorization(g))+1)

Buggy submission (verdict: Runtime Error):
import math


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = math.gcd(a, b)
if g == 1:
    print('1')
else:
    print(len(factorization(g))+1)

Buggy submission (verdict: Runtime Error):
import math


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = math.gcd(a, b)
if g == 1:
    print('1')
else:
    print(len(factorization(g))+1)
Problem p03860 (python)

Fixed submission:
a,b,c=map(str,input().split())
print('{}{}{}'.format(a[0],b[0],c[0]))

Buggy submission (verdict: Runtime Error):
b=input().split
print("A"+b[1]+"c")
Problem p04011 (python)

Fixed submission:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
print(k*x+(n-k)*y if n-k>=0 else n*x)

Buggy submission (verdict: Runtime Error):
n,k,x,y=[int(input()) for_ in range(4)]
print(min(n, k)*x+max(n-k,0)*y)
Problem p02898 (python)

Fixed submission:
N,K=map(int,input().split())
h_i=list(int(x) for x in input().split())
count=0

for i in range(N):
  if h_i[i] >= K:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h_i=(int(x) for x in input().split())
count=0
for i in range(N):
  if h_i[i] >= K:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h_i=(int(x) for x in input().split())
count=0
for i in range(N):
  if h_i[i] => K:
    count+=1
print(count)
Problem p03076 (python)

Fixed submission:
a = [ int(input()) for _ in range(5)]
n = float("inf")
for i in range(5):
    if 0 < a[i] % 2 < 10:
        n = min(n,a[i] % 10)
else:
    if n == float("inf"):
        n = 10
print(sum([(-a[i]//10)*-10 for i in range(5)]) -(10-n))

Buggy submission (verdict: Runtime Error):
a = [int(input()) for _ in range(5)]
b = 10-min([a[i]%10 for i in range(5) if 0 < a[i]%10] or 10)
print(sum([(-(-a[i]//10)) for i in range(5)])*10-b)

Buggy submission (verdict: Runtime Error):
a = [int(input()) for _ in range(5)]
b = 10-min([a[i]%10 for i in range(5) if 0 <a[i]%10])
print(sum([(-(-a[i]//10)) for i in range(5)])*10-b)
Problem p03160 (python)

Fixed submission:
nums = int(input())
ary = list(map(int,input().split()))
dp = [0 for i in range(nums)]
for i in range(1,nums):
    dp[i] = float("inf")
jump_min = 0
for i in range(1,nums):
    for x in range(1,3):
        jump = i-x
        if i-x < 0: continue
        jump = dp[i-x] + abs(ary[i-x] - ary[i])
        if jump < dp[i]:
            dp[i] = jump
print(dp[nums-1])

Buggy submission (verdict: Runtime Error):
def f(i):
    if memo[i] != float("Inf"):return memo[i]

    memo[i] = min(memo[i],f(i-1)+abs(ary[i-1]-ary[i]))
    if i > 1:memo[i] = min(memo[i],f(i-2)+abs(ary[i-2]-ary[i]))

    return memo[i]
n = int(input())
ary = list(map(int,input().split()))
memo = [float("Inf") for _ in range(n)]
memo[0] = 0
print(f(n-1))
Problem p03162 (python)

Fixed submission:
nums = int(input())
ary = [0 for i in range(nums)]
for i in range(nums):
    ary[i] = list(map(int,input().split()))

dp = [0 for i in range(nums+1)]
for i in range(len(dp)):
    dp[i] = [0,0,0]

for i in range(nums):
    for x in range(3):
        for y in range(3):
            if x == y: continue
            check = dp[i][x] + ary[i][y]
            if check >= dp[i+1][y]:
                dp[i+1][y] = check

result= 0
for i in range(3):
    if result < dp[nums][i]:
        result = dp[nums][i]
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
ary = [list(map(int,input().split())) for _ in range(n)]
ary = np.array(ary,dtype=int)
dp = np.zeros((n,3),dtype=int)
dp[0] = ary[0]
for i in range(1,n):
    for j in range(3):
        for k in range(3):
            if j == k:continue
            if dp[i][j] < dp[i-1][k]+ary[i][j]:
                dp[i][j] = dp[i-1][k] + ary[i][j]
print(max(dp[n-1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
ary = [list(map(int,input().split())) for _ in range(n)]
ary = np.array(ary)
dp = np.zeros((n,3))
dp[0] = ary[0]
for i in range(n-1):
    for j in range(3):
        for k in range(3):
            if k == j:continue
            check = dp[i][j] + ary[i+1][k]
            if check > dp[i+1][k]:
                dp[i+1][k] = check
print(int(max(dp[n-1])))
Problem p03262 (python)

Fixed submission:
import fractions
N, X = map(int, input().split())
ary = list(map(int, input().split()))
arr = [abs(i - X) for i in ary]
ans = arr[0]
for i in range(1,N):
    ans = fractions.gcd(ans, arr[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import fractinos
N, X = map(int, input().split())
ary = list(map(int, input().split()))
arr = [i - X for i in ary]
ans = arr[0]
for i in range(1,N-1):
    ans = fractions.gcd(ans,arr[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, X = map(int, input().split())
ary = list(map(int, input().split()))
arr = [i - X for i in ary]
ans = arr[0]
for i in range(1,N-1):
    ans = math.gcd(ans,arr[i])
print(ans)
Problem p03274 (python)

Fixed submission:
N, K = map(int, input().split())
ary = [0] + list(map(int, input().split()))
ary.sort()
zero = ary.index(0)
a = [abs(i - zero) for i in range(N + 1)]
ary.pop(zero)
ans = float("Inf")
for i in range(N - K + 1):
    b = N - i - 1
    d = abs(ary[i])
    if a[i] >= K:
        ans = min(ans, d)
    ans = min(ans, d + abs(ary[i] - ary[i + K - 1]))
    d = abs(ary[b])
    if a[b] >= K:
        ans = min(ans, d)
    ans = min(ans, d + abs(ary[b] - ary[b - K + 1]))
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
ary = [0] + list(map(int, input().split()))
ary = sorted(ary)
a = ary.index(0)
ans = float("Inf")
for i in range(N + 1):
    if i == a: continue

    k = abs(i - a)
    d = abs(ary[i])
    if k >= K and ans > d:
        ans = d
    if i < a:
        try:
            k = K - abs(i - a)
            d = abs(ary[i])
        except:print(1)
        if k > 0:
                d += abs(ary[i] - ary[k + a])
                if ans > d:
                    ans = d

print(0 if ans == float("Inf") else ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
ary = [0]+list(map(int,input().split()))
ary = sorted(ary)
a = ary.index(0)
ans = float("Inf")
for i in range(N+1):
        if i == a:continue
        k = abs(i - a)
        d = abs(ary[i])
        if k >= K and ans > d:
            ans = d
        if i <= a:
            k = K - abs(i-a)
            d = abs(ary[i])
            if k > 0:
                d += abs(ary[i] - ary[k+a])
                if ans > d:
                    ans = d
print(0 if ans == float("Inf") else ans)
Problem p03379 (python)

Fixed submission:
n = int(input())
ary = list(map(int,input().split()))
a = sorted(ary)
b = (len(ary)+1)//2-1
for i in range(n):
    if a[b] < ary[i]:
        print(a[b])
    elif a[b] == ary[i]:
        print(a[b+1])
    elif a[b] > ary[i]:
        print(a[b+1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ary = list(map(int,input().split()))
a = sorted(ary)
c = (len(ary)+1)//2-1
for i in range(n):
    b = a.copy()
    b.remove(ary[i])
    print(b[c])
Problem p03386 (python)

Fixed submission:
a, b, k = map(int,input().split())
n = range(a,b+1)
print(*sorted(set(n[:k]) | set(n[-k:])),sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
n = list(range(b+1))
print(*sorted(set(n[a:(a+k)]) | set(n[-k:])),sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
n = list(range(a,b+1))
print(*sorted(set(n[:k]) | set(n[-k:])),sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
n = list(range(a,b+1))
print(*sorted(set(n[:k]) | set(n[-k:])),sep="\n")
Problem p03387 (python)

Fixed submission:
import sys
ary = list(map(int,input().split()))
count = 0
#最初から同じだった時
if ary[0] == ary[1] == ary[2]:
    print(0)
    sys.exit()

#和が偶数だった時
if (ary[0] + ary[1] + ary[2]) % 2 == 0:
    for i in range(3):
        if ary[i] % 2 == 1:
            ary[i] += 1
            count += 0.5
# 和が奇数だった時
elif (ary[0] + ary[1] + ary[2]) % 2 == 1:
    for i in range(3):
        if ary[i] % 2 == 0:
            ary[i] += 1
            count += 0.5

while not ary[0] == ary[1] == ary[2]:
    ary.sort()
    ary[0] += 2
    count += 1

print(int(count))

Buggy submission (verdict: Runtime Error):
import numpy as np
*a, = map(int,input().split())
a = np.array(a)
dp = [0]*3
count = 0
if a[0] == a[1] == a[2]:print(0);exit()
for i in range(3):
    if a[i] % 2 == 1:dp[i] = 1
if dp.count(1) == 2:
    for i in range(len(a)):
        if dp[i] == 1:a[i] += 1
    count += 1
    while not a[0] == a[1] == a[2]:
        a[np.argmin(a)] += 2
        count += 1
elif dp.count(0) == 2:
    for i in range(len(a)):
        if dp[i] == 0:a[i] += 1
    count += 1
    while not a[0] == a[1] == a[2]:
        a[np.argmin(a)] += 2
        count += 1
else:
    while not a[0] == a[1] == a[2]:
        a[np.argmin(a)] += 2
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import sys
ary = list(map(int,input().split()))
parity = 0
count = 0
#最初から同じだった時
if ary[0] == ary[1] == ary[3]:
    print(0)
    sys.exit()

#和が偶数だった時
if (ary[0] + ary[1] + ary[2]) % 2 == 0:
    for i in range(3):
        if ary[i] % 2 == 1:
            ary[i] += 1
            count += 0.5
        print(ary)
# 和が奇数だった時
elif (ary[0] + ary[1] + ary[2]) % 2 == 1:
    for i in range(3):
        if ary[i] % 2 == 0:
            ary[i] += 1
            count += 0.5
while not ary[0] == ary[1] == ary[2]:
    ary.sort()
    ary[0] += 2
    count += 1
    
print(int(count))
Problem p03455 (python)

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

result = x * y

if (result % 2) == 0 :
    print('Even')
else:
    print('Odd')

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

if: ((x * y ) % 2) == 0
  print('Even')
  
else: 
  print('Odd')

Buggy submission (verdict: Runtime Error):
aaaa
Problem p03471 (python)

Fixed submission:
import sys
nums , money = map(int,input().split())

for i in range(nums+1):

    for x in range( nums +1 -i):

        if (i * 10000) + (x *5000) + ((nums -(i+x))*1000) == money:
            print(str(i) +" " + str(x) +" " +str((nums -(i +x))))
            sys.exit()

else:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
n,y = map(int,input().split())
a,b,c = 10000,5000,1000
for i in range(y//a+1):
    total = 0
    for j in range((y-(a*i))//b+1):
        d = (y-(a*i)-(b*j))//c
        if i+j+d == n:print(i,j,d);exit()
eles:print(-1,-1,-1)
Problem p03495 (python)

Fixed submission:
nums , types = map(int, input().split())
array = list(map(int,input().split()))
array.sort()
type_count = 0
count = 0
result = 0
ary_count = []
array.append(1000000000)

for i in range (nums):
    if array[i] == array[i +1]:
        count += 1
    elif array[i] < array[i +1]:
        ary_count.append(count)
        type_count += 1
        count = 0

ary_count.sort()

if type_count > types:
    for i in range(type_count - types):
        result += ary_count[i]+1
print(result)

Buggy submission (verdict: Runtime Error):
nums , types = map(int, input().split())
array = list(map(int,input().split()))
array.sort()
type_count = 0
count = 0
result = 0
ary_count = []
array.append(1000000000)

for i in range (nums):
    if array[i] == array[i + 1]:
        count += 1
    elif array[i] < array[i+1]:
        ary_count.append(count)
        type_count += 1
        count = 0

if type_count > types:
    for i in range(type_count - types):
        result += min(ary_count+1)
print(result)
Problem p03565 (python)

Fixed submission:
s = input()
S = input()
flag = False
ans = []
for i in range(len(s)-len(S)+1):
    if s[i] == S[0] or s[i] == "?":
        a = s[i:i+len(S)]
        for j in range(len(S)):
            if a[j] == S[j] or a[j] == "?":
                continue
            break
        else:
            flag = True
            ans.append(s[:i]+S+s[i+len(S):])
if not flag:
    print("UNRESTORABLE")
    exit()
for i in range(len(ans)):
    ans[i] = ans[i].replace("?","a")
ans.sort()
print(ans[0])

Buggy submission (verdict: Runtime Error):
s = input()
S = input()
flag = False
for i in range(len(s)-len(S)+1):
    if s[i] == S[0] or s[i] == "?":
        a = s[i:i+len(S)]
        for j in range(len(S)):
            if a[j] == S[j] or a[j] == "?":
                continue
            break
        else:
            flag = True
            s = s[0:i]+S+s[i+len(S):-1]
print(s.replace("?","a") if flag == True else "UNRESTORABLE")
Problem p03576 (python)

Fixed submission:
n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary.sort()

ans = float("Inf")
for i in range(n-k+1):
    for j in range(k,n-i+1):
        xmin = ary[i][0]
        xmax = ary[i+j-1][0]
        ary_y = sorted(ary[i:i+j], key=lambda x: (x[1]))
        for l in range(len(ary_y)-k+1):
            ymin = ary_y[l][1]
            ymax = ary_y[l+k-1][1]
            ans = min(ans,(xmax - xmin) * (ymax - ymin))
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary.sort()

ans = float("Inf")
for i in range(n-k+1):
    for j in range(k,n-i+1):
        xmin = ary[i][0]
        xmax = ary[i+j-1][0]
        ary_y = sorted(ary[i:i+j], key=lambda x: (x[1]))
        for l in range(len(ary_y)-k+1):
            ymin = ary_y[l][1]
            ymax = ary_y[l+k-1][1]
            ans = min(ans,(xmax - xmin) * (ymax - ymin))
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary_x = sorted(ary)
ary_y = sorted(ary,key=lambda x:(x[1],x[0]))
num = np.array(ary,dtype=float)
ans = float("Inf")

for xi in range(n):
    for xj in range(1,n):
        for yi in range(n):
            for yj in range(1,n):
                count = 0
                lx,rx = ary_x[xi][0],ary_x[xj][0]
                by,uy = ary_y[yi][1],ary_y[yj][1]

                for i in range(n):
                    if lx <= ary[i][0] <= rx and by <= ary[i][1] <= uy:
                        count += 1
                if count >= k:
                    ans = min(ans,(rx - lx) * (uy - by))
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
n,k = map(int,input().split())
ary = np.array([list(map(int,input().split())) for _ in range(n)],dtype=float)
a = list(itertools.combinations(ary,k))
ans = float("Inf")
for i in a:
    min_a = np.min(i,axis=0)
    max_a = np.max(i,axis=0)
    a = max_a[0] - min_a[0]
    b = max_a[1] - min_a[1]
    ans = min(ans,int(a)*int(b))
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
n,k = map(int,input().split())
ary = np.array([list(map(int,input().split())) for _ in range(n)],dtype=float)
a = list(itertools.combinations(ary,k))
ans = float("Inf")
for i in a:
    min_a = np.min(i,axis=0)
    max_a = np.max(i,axis=0)
    ans = min(ans,(max_a[0] - min_a[0]) * (max_a[1] - min_a[1]))
print(int(ans))
Problem p03599 (python)

Fixed submission:
ope1,ope2,ope3,ope4,concent,capacity = map(int,input().split())
ope1 *= 100
ope2 *= 100
noudo = 0
check = 0
check_capacity = 0
result =str(ope1)+" "+"0"

for i in range(int(capacity / ope1)+1):
    for x in range(int( (capacity -(i*ope1)) /ope2 )+1):
        if i+x == 0:
            continue
        for y in range(int( (capacity -(i*ope1 +x*ope2)) /ope3)+1):
            for z in range( int( (capacity -(i*ope1 +x*ope2 +y*ope3) ) /ope4)+1):
                if y+z ==0:
                    continue
                check = (100 *(y*ope3 + z*ope4)) / ( i*ope1 + x*ope2 + y*ope3 + z*ope4)

                if check > noudo and ((i*ope1+x*ope2)/100)*concent>= y*ope3+z*ope4:
                    noudo = check
                    result = (str(i*ope1+x*ope2+y*ope3+z*ope4)+" "+str(y*ope3+z*ope4))
print(result)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
A *= 100
B *= 100
check = 0
for i in range(F//A+1):
    for j in range((F-(A*i))//B+1):
        if i + j == 0:continue
        for k in range(((F-(A*i))-B*j)//C+1):
            for l in range((((F-(A*i))-B*j)-C*k)//D+1):
                water = A*i+B*j
                sugar = C*k+D*l
                if water//100*E < sugar:continue
                if check < 100*sugar/(water+sugar):
                    check = 100*sugar/(water+sugar)
                    ans = [water+sugar,sugar]
print(*ans)
Problem p03612 (python)

Fixed submission:
n = int(input())
ary = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i == n-1 and i+1 == ary[i]:
        ans += 1
    elif i+1 == ary[i]:
        a = ary[i]
        b = ary[i+1]
        ary[i] = b
        ary[i+1] = a
        ans += 1
    else:continue
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ary = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == ary[i]:
        a = ary[i]
        b = ary[i+1]
        ary[i] = b
        ary[i+1] = a
        ans += 1
    else:continue
print(ans)
Problem p03624 (python)

Fixed submission:
strings = list(input())
alfabet  = 'abcdefghijklmnopqrstuvwxyz'

for i in alfabet:
    if strings.count(i) == 0:
        result = i
        break
else:
    result = "None"

print(result)

Buggy submission (verdict: Runtime Error):
strings = list(input())
alfabet  = 'abcdefghijklmnopqrstuvwxyz'
for i in alfabet:
    if strings.count(i) <= 1:
        result = i
        break

print(result)
Problem p03625 (python)

Fixed submission:
n = int(input())
a = sorted(list(map(int,input().split())),reverse=True)
a += [0]
b = -1
ans = [0,0]
count = 0
for i in range(n+1):
    count += 1
    if b != a[i]:
        if count >= 4:
            if ans[0]:
                ans[1] = b
                break
            else:
                ans[0] = b
                ans[1] = b
                break
        elif count >= 2:
            if ans[0]:
                ans[1] = b
                break
            else:ans[0] = b
        b = a[i]
        count = 0
print(ans[0]*ans[1])

Buggy submission (verdict: Runtime Error):
b = -1
ans = [0,0]
count = 0
for i in range(n+1):
    count += 1
    if b != a[i]:
        if count >= 2:
            if ans[0]:
                ans[1] = b
                break
            else: ans[0] = b
        b = a[i]
        count = 0
print(ans[0]*ans[1])
Problem p03633 (python)

Fixed submission:
import fractions
n = int(input())
ans = 1
for i in range(n):
    a = int(input())
    ans = ans // fractions.gcd(ans,a) * a
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ary = [int(input()) for _ in range(n)]
ans = 1
for i in ary:
    ans = (ans*i)//math.gcd(ans,i)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = int(input())
for i in range(n-1):
    a = int(input())
    ans = ans // math.gcd(ans,a) * a
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = int(input())
for i in range(n-1):
    a = int(input())
    ans = ans // math.gcd(ans,a) * a
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = int(input())
for i in range(n-1):
    a = int(input())
    ans = ans // math.gcd(ans,a) * a
print(ans)
Problem p03657 (python)

Fixed submission:
a,b = map(int,input().split())
print("Possible" if a%3 == 0 else "Possible" if b%3 == 0 else "Possible" if (a+b)%3 == 0 else "Impossible")

Buggy submission (verdict: Runtime Error):
a,b = int(input()),int(input())
print("Possible" if a*b*(a+b)%3==0 else "Impossible")
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
if n % 2 == 0:
    a = a[::-2]+a[0::2]
else: a = a[::-2] +a[1::2]
print(*a,sep=" ")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
print(*s[::-2],*s[n%2::2])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
print(*s[::-2],*s[n%2::2])
Problem p03695 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = set()
all = 0
for i in a:
    if i >= 3200:
        all += 1
    else:s.add(i//400)
if not s:
    print(1,end=" ")
else:print(len(s),end=" ")
print(len(s)+all)

Buggy submission (verdict: Runtime Error):
n,*a = map(int,open(0).read().split())
b = filter(lambda x:x < 3200,a)
c = len(set([i//400 for i in b]))
print(c or 1,end=" ")
print(c + n-len(b))

Buggy submission (verdict: Runtime Error):
n,*a = map(int,open(0).read().split())
b = filter(lambda x:x < 3200,a)
c = set([i//400 for i in b])
print(c or 1,end=" ")
print(c + n-len(b))
Problem p03699 (python)

Fixed submission:
n = int(input())
a = sorted(int(input()) for _ in range(n))
ans = sum(a)
if ans % 10 != 0:
    print(ans)
    exit()
else:
    for i in a:
        if (ans-i) % 10 != 0:
            print(ans-i)
            exit()
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
dp = [[] for _ in range(n+1)]
for i in range(n+1):
    dp[i] += [-1 for _ in range(10010)]
dp[0][0] = 1
for i in range(n):
    for j in range(10010):
        if dp[i][j] == 1:
            dp[i+1][j] = 1
            dp[i+1][j+a[i]] = 1

for i in range(10010):
    if dp[n][i] == 1:
        if i % 10 != 0:
            ans = max(ans,i)
print(ans)
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == b :
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a == b :
  print("H")
else:
  print("D")
Problem p03797 (python)

Fixed submission:
S,C = map(int,input().split())
if C <= 1:ans = 0
elif C//2 >= S:ans = S+(C-S*2) //4
else:ans = C//2
print(ans)

Buggy submission (verdict: Runtime Error):
S,C = map(int,input().split())
if C >= S*2:ans = S
ans += (C-ans*2) // 4
print(ans)
Problem p04044 (python)

Fixed submission:
num,strings = map(int,input().split())
result = ""
str_array = []

for i in range (num):
    str_array.append(input())

str_array.sort()

for x in range (num):
    result = result + str_array[x]

print(result)

Buggy submission (verdict: Runtime Error):
strings,num = map(int,input().split())
result = ""
str_array = []

for i in range (num):
    str_array.append(input())

str_array.sort()

for i in range (num):
    result += str_array[i]

print(result)

Buggy submission (verdict: Runtime Error):
strings,num = map(int,input().split())
result = ""
str_array = []

for i in range (strings):
    str_array.append(input())

str_array.sort()

for i in range (num):
    result += str_array[i]

print(result)
Problem p03105 (python)

Fixed submission:
a, b, c = map(int, input().split())
i=0
while(a*i<=b and i<=c):
    i += 1
print(i-1)

Buggy submission (verdict: Runtime Error):
a