Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
for k in range(0, K):
    H[k] = 0
# print(H)
print(sum(H))

Fixed submission:
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
I = K if K <= N else N
for i in range(0, I):
    H[i] = 0
# print(H)
print(sum(H))

Buggy python submission (verdict: Runtime Error):
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort()
for k in range(0, K-1):
    H[k] = 0
print(sum(H))

Fixed submission:
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
I = K if K <= N else N
for i in range(0, I):
    H[i] = 0
# print(H)
print(sum(H))
Buggy python submission (verdict: Time Limit Exceeded):
X, K, D = map(int, input().split())
ans = float('inf')
for bit in range(2**K):
    ans_pre = X
    for i in range(K):
        if bit & (1<<i):
            ans_pre += D
        else:
            ans_pre -= D
            
    ans = min(ans, abs(ans_pre))
    
print(ans)

Fixed submission:
X, K, D = map(int, input().split())

low = 0
high = K

while low <= high:
    mid = (low + high) //2
    i = mid
    j = K-mid
    ans_pre = (X + D*i - D*j)
    if ans_pre > 0:
        high = mid-1
    else:
        low = mid+1
        

if low > K :
    low = high
if high < 0:
    high = low
    
ans_h = min(abs((X + D*high - D*(K-high))), abs(X + D*(K-high)-D*high))
ans_l = min(abs((X + D*low - D*(K-low))), abs(X + D*(K-low)-D*low))
    
print(min(ans_l, ans_h))
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = [0]*N
n = int((N)**(0.5))+1
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            i = x**2+y**2+z**2+x*y+x*z+y*z
            if i > N:
                break
            else:
                ans[i] += 1
for a in ans:
    print(a)

Fixed submission:
N = int(input())
ans = [0]*N
if N > 3:
    n = int((N-3)**(0.5))+1
    nums = [i for i in range(1, n)]
    for x in range(1, n):
        for y in range(1, n):
            for z in range(1, n):
                i = x**2+y**2+z**2+x*y+x*z+y*z
                if i > N:
                    break
                else:
                    ans[i-1] += 1
for a in ans:
    print(a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans = ''

while N > 0:
    N-=1
    index = N%26
    ans = alpha[index] + ans
    N = N // 26
print(ans)


Fixed submission:
alpha = input()

if alpha.isupper():
    print('A')
else:
    print('a')
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
N, K = map(int, input().split())
P = list(map(int, input().split()))

ans = float('inf')

for buy_list in list(combinations(P, K)):
    ans_ = 0
    for buy in buy_list:
        ans_ += buy
    ans = min(ans, ans_)
    
print(ans)

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

p_list = sorted(p_list)

print(sum(p_list[:K]))
Buggy python submission (verdict: Runtime Error):
import math
# A, B, H, M = 3, 4, 9, 0
A, B, H, M = map(int, input().split())

deg = 0
deg += 5.5 * M
deg -= 30 * H

print(math.sqrt(A**2 + B**2 - 2*A*B* math.cos(math.radians(abs(deg)))))

Fixed submission:
one = int(input()) % 10


hon_list = [2, 4, 5, 7, 9]

if one in hon_list:
    print('hon')
elif 3 == one:
    print('bon')
else:
    print('pon')

Buggy python submission (verdict: Runtime Error):
import math
 
a, b, h, m = map(int, input().split())
 
deg = 0
 
deg += 5.5 * m
deg -= 30 * h
 
print(math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(abs(deg)))))

Fixed submission:
one = int(input()) % 10


hon_list = [2, 4, 5, 7, 9]

if one in hon_list:
    print('hon')
elif 3 == one:
    print('bon')
else:
    print('pon')

Buggy python submission (verdict: Runtime Error):
import math
# A, B, H, M = 3, 4, 9, 0
A, B, H, M = map(int, input().split())

deg = 0
deg += 5.5 * M
deg -= 30 * H

print(math.sqrt(A**2 + B**2 - 2*A*B* math.cos(math.radians(abs(deg)))))

Fixed submission:
one = int(input()) % 10


hon_list = [2, 4, 5, 7, 9]

if one in hon_list:
    print('hon')
elif 3 == one:
    print('bon')
else:
    print('pon')

Buggy python submission (verdict: Runtime Error):
import math
# A, B, H, M = 3, 4, 9, 0
A, B, H, M = map(int, input().split())

sa = abs(H* 30-M*5.5)
cos = math.cos(math.radians(sa))
ans = math.sqrt(A**2 + B**2 - 2*A*B*cos)
print(ans)

Fixed submission:
one = int(input()) % 10


hon_list = [2, 4, 5, 7, 9]

if one in hon_list:
    print('hon')
elif 3 == one:
    print('bon')
else:
    print('pon')

Buggy python submission (verdict: Runtime Error):
import math
# A, B, H, M = 3, 4, 9, 0
A, B, H, M = map(int, input().split())

sa = abs(H* 30-M*5.5)
cos = abs(math.cos(math.radians(sa)))
ans = math.sqrt(A**2 + B**2 - 2*A*B*cos)
print(ans)

Fixed submission:
one = int(input()) % 10


hon_list = [2, 4, 5, 7, 9]

if one in hon_list:
    print('hon')
elif 3 == one:
    print('bon')
else:
    print('pon')
Buggy python submission (verdict: Runtime Error):
import math
from itertools import permutations 
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
ans_ = 0
count = 0
for x, y, z in permutations(range(N), N):
    x1, y1 = xy[x]
    x2, y2 = xy[y]
    x3, y3 = xy[z]
    ans_ += math.sqrt((x1-x2)**2+(y1-y2)**2)+math.sqrt((x3-x2)**2+(y3-y2)**2)
    count += 1
print(ans_ / count)

Fixed submission:
import itertools
N = int(input())
xy_list = [list(map(int, input().split())) for _ in range(N)]

ans = 0
num = 0
for xy in itertools.permutations(xy_list):
    ans_pre = 0
    for i in range(N-1):
        ans_pre += ((xy[i][0]-xy[i+1][0])**2 + (xy[i][1]-xy[i+1][1])**2)**(0.5)
    num += 1
    ans += ans_pre
print(ans/num)

Buggy python submission (verdict: Runtime Error):
import math
from itertools import permutations 
N = int(input())
xy = [list(map((int, input().spllit()))) for _ in range(N)]
ans_ = 0
count = 0
for x, y, z in permutations(range(N), N):
    x1, y1 = xy[x]
    x2, y2 = xy[y]
    x3, y3 = xy[z]
    ans_ += math.sqrt((x1-x2)**2+(y1-y2)**2)+math.sqrt((x3-x2)**2+(y3-y2)**2)
    count += 1
print(ans_ / count)

Fixed submission:
import itertools
N = int(input())
xy_list = [list(map(int, input().split())) for _ in range(N)]

ans = 0
num = 0
for xy in itertools.permutations(xy_list):
    ans_pre = 0
    for i in range(N-1):
        ans_pre += ((xy[i][0]-xy[i+1][0])**2 + (xy[i][1]-xy[i+1][1])**2)**(0.5)
    num += 1
    ans += ans_pre
print(ans/num)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()

ans = 0
for b in B:
    a_index = bisect.bisect_left(A, b)
    c_index = bisect.bisect_right(C, b)
    ans += len(A[:a_index])*len(C[c_index:])
print(ans)

Fixed submission:
import bisect
n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for b in B:
    a_ind = bisect.bisect_left(A, b)
    c_ind = bisect.bisect_right(C, b)
    ans += a_ind*(n-c_ind)
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()

ans = 0
for a in A:
    b_index = bisect.bisect_right(B, a)
    for b in B[b_index:]:
        ans += len(C[bisect.bisect_right(C,b):])
print(ans)

Fixed submission:
import bisect
n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for b in B:
    a_ind = bisect.bisect_left(A, b)
    c_ind = bisect.bisect_right(C, b)
    ans += a_ind*(n-c_ind)
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

ans = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if (x+y+z) == s:
                ans+=1
print(ans)


Fixed submission:
k, s = map(int, input().split())
count = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if 0 <= z <= k:
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        ans += A[i] * A[j]
ans %= 10**9+7
print(ans)

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

A_sum = sum(A)
ans = 0
for i in range(n-1):
    A_sum -= A[i]
    ans += A[i] * A_sum
ans %= 10**9+7
print(ans)
Buggy python submission (verdict: Runtime Error):
# Union find
# かっつぱさんの解説と公式のスライドみた
# https://www.youtube.com/watch?time_continue=916&v=zxor0DdwoXA&feature=emb_logo
# https://www.slideshare.net/chokudai/union-find-49066733

import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(m)]

root = [-1]*n

def find(x):
    if root[x] < 0:
        return x
    else:
        root[x] = find(root[x])
        return root[x]

def unite(x, y):
    gx = find(x)
    gy = find(y)
    
    if gx == gy:
        return
      
    if root[gx] > root[gy]:
        gx, gy = gy, gx
        
    root[gx] += root[gy]
    root[gy] = gx
    print(root)

def size(x):
    x = find(x)
    return -root[x]

for a, b in AB:
    a -= 1
    b -= 1
    unite(a, b)

ans = 0
for i in range(n):
    ans = max(ans, size(i))
print(ans)

Fixed submission:
# Union find
# かっつぱさんの解説と公式のスライドみた
# https://www.youtube.com/watch?time_continue=916&v=zxor0DdwoXA&feature=emb_logo
# https://www.slideshare.net/chokudai/union-find-49066733

import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(m)]

root = [-1]*n

def find(x):
    if root[x] < 0:
        return x
    else:
        root[x] = find(root[x])
        return root[x]

def unite(x, y):
    gx = find(x)
    gy = find(y)
    
    if gx == gy:
        return
      
    if root[gx] > root[gy]:
        gx, gy = gy, gx
        
    root[gx] += root[gy]
    root[gy] = gx

def size(x):
    x = find(x)
    return -root[x]

for a, b in AB:
    a -= 1
    b -= 1
    unite(a, b)

ans = 0
for i in range(n):
    ans = max(ans, size(i))
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input().split())
A = np.array(list(map(int, input().split())))
S = A.cumprod().tolist()
#print(S)

tmp = S[k-1]
for i in range(n-k):
    if tmp*S[i] < S[k+i]:
        print("Yes")
    else:
        print("No")
    #print(tmp, S[k+i]/S[i])

    tmp = S[k+i]//S[i]
    

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

for i in range(n-k):
    if A[i] < A[k+i]:
        print("Yes")
    else:
        print("No")

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

n, k = map(int, input().split())
A = np.array(list(map(int, input().split())))

S = A.cumprod().tolist()
#print(S)
tmp = S[k-1]
for i in range(n-k):
    if tmp < S[k+i]/S[i]:
        print("Yes")
    else:
        print("No")
    #print(tmp, S[k+i]/S[i])

    tmp = S[k+i]/S[i]


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

for i in range(n-k):
    if A[i] < A[k+i]:
        print("Yes")
    else:
        print("No")

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

n, k = map(int, input().split())
A = np.array(list(map(int, input().split())))

S = A.cumprod().tolist()
#print(S)
tmp = S[k-1]
for i in range(k-1):
    if tmp < S[k+i]/S[i]:
        print("Yes")
    else:
        print("No")
    #print(tmp, S[k+i]/S[i])

    tmp = S[k+i]/S[i]



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

for i in range(n-k):
    if A[i] < A[k+i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

ANS = [0] * (n)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)
    

Fixed submission:
n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1, n+1):
    cnt = 0
    for x in range(1, 50):
        for y in range(1, 50):
            for z in range(1, 50):
                
                if i == ((x+y+z)**2 - z*(x+y) - (x*y)):
                    cnt += 1

    print(cnt)

Fixed submission:
n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1, n+1):
    cnt = 0
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                
                if i == ((x+y+z)**2 - z*(x+y) - (x*y)):
                    cnt += 1

    print(cnt)

Fixed submission:
n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1, n+1):
    cnt = 0
    for x in range(1, 31):
        for y in range(1, 31):
            for z in range(1, 31):
                
                if i == ((x+y+z)**2 - z*(x+y) - (x*y)):
                    cnt += 1

    print(cnt)

Fixed submission:
n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
C = [list(map(str, input())) for _ in range(h)]

n = h + w
tmp = [0] * (n)
for idx, ch in enumerate(C):
    tmp[idx] = ch.count("#")
    for i, c in enumerate(ch):
        if c == "#": tmp[i + 2] += 1

if k > w:
    cnt = 1
    for i in range(n):
        if tmp[i] == k: cnt += 1

else:
    cnt = 0
    for i in range(n):
        if tmp[i] == k: cnt += 1
        for j in range(n - i):
            if i == j: continue
            if (tmp[i] + tmp[j]) == k: cnt += 1
print(cnt)

Fixed submission:
#bit全探索
#解説AC

H, W, K = map(int, input().split())
C = [list(map(str, input())) for _ in range(H)]

ans = 0
#1<<n : 2^n
for i in range(1<<H):
    for j in range(1<<W):
      cnt = 0
      for h in range(H):
        for w in range(W):
          #1>>n : 下からn桁目(0 index)
          if (i>>h & 1): continue
          if (j>>w & 1): continue
          cnt += C[h][w] == '#'

      if cnt == K: ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import *
from operator import mul

n = int(input())
A = list(map(int, input().split()))
q = int(input())


A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp*(c - b)
    print(A_sum)

Fixed submission:
import sys
input=lambda :sys.stdin.readline().rstrip()

def num2alpha(num):
    if num<=26:
        return chr(96+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(122)
    else:
        return num2alpha(num//26)+chr(96+num%26)

n = int(input())
print(num2alpha(n))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import *
from operator import mul

n = int(input())
A = list(map(int, input().split()))
q = int(input())


A_dic = Counter(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    v, c = zip(*A_dic.most_common())
    ans = map(mul, v, c)
    print(sum(ans))

Fixed submission:
from collections import *
from operator import mul

n = int(input())
A = list(map(int, input().split()))
q = int(input())


A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp*(c - b)
    print(A_sum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
q = int(input())

for _ in range(q):
    b, c = map(int, input().split())
    A = [c if a==b else a for a in A]
    print(sum(A))

Fixed submission:
from collections import *
from operator import mul

n = int(input())
A = list(map(int, input().split()))
q = int(input())


A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp*(c - b)
    print(A_sum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(1, MAX_N):
    if cnt[a] <= 2: 
      tmp = a * i
      if tmp > MAX_N: break
      cnt[tmp] += 1
ans = 0
for a in tuple(set(A)):
  if cnt[a] == 1:
    ans += 1
print(ans)

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

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] <= 2: cnt[i] += 1

ans = 0
for a in A:
  if cnt[a] == 1: ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

def divisor(n):
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i ** 2 == n:
                continue
            d.append(n // i)
    return d

n = int(input())
A = list(map(int, input().split()))
set_A = set(A)

cnt = [0]*(max(A)+1)
for a in A:
    tmp = set(divisor(a)) & set_A
    if len(tmp) == 1: cnt[a] += 1

ans = collections.Counter(cnt)
print(ans[1])

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

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] <= 2: cnt[i] += 1

ans = 0
for a in A:
  if cnt[a] == 1: ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

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

if 0 in A:
  print(0)
  exit()

counter = collections.Counter(A)
ans = 1
for k, v in counter.items():
  ans *= k ** v
if ans > 10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 2
    A = [1000000000, 1000000000]

  else:
    ##INPUT 
    n = input()
    A = list(map(int, input().split()))

  ## SUBMITION CODES HERE
  if 0 in A:
    print(0)
    exit()
  
  ans = 1
  for a in A:
    ans *= a
    if ans > 10**18:
      ans = -1
      break
  
  print(ans)
    
main()

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(float, input().split())
print(math.floor(a*b))

Fixed submission:
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 2
    A = [1000000000, 1000000000]

  else:
    ##INPUT 
    n = input()
    A = list(map(int, input().split()))

  ## SUBMITION CODES HERE
  if 0 in A:
    print(0)
    exit()
  
  ans = 1
  for a in A:
    ans *= a
    if ans > 10**18:
      ans = -1
      break
  
  print(ans)
    
main()
Buggy python submission (verdict: Runtime Error):
def main():
  ## IMPORT MODULE
  #import sys
  from collections import Counter

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 64

  else:
    ##INPUT 
    n = input()
    #a, b = map(int, input().split())

  ## SUBMITION CODES HERE
  def prime_fact(n):
    P= []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

  cnt = Counter(prime_fact(n))

  ans = 0
  for c in cnt.values():
    tmp = 1
    while c >= tmp:
      c -= tmp
      ans += 1
      tmp += 1
    
  print(ans)
    
main()

Fixed submission:
from collections import Counter

def prime_fact(n):
    P= []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

n = int(input())
cnt = Counter(prime_fact(n))

ans = 0
for c in cnt.values():
  tmp = 1
  while c >= tmp:
    c -= tmp
    ans += 1
    tmp += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
def main():
  ## IMPORT MODULE
  #import sys
  from collections import Counter

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 64

  else:
    ##INPUT 
    n = input()
    #a, b = map(int, input().split())

  ## SUBMITION CODES HERE
  def prime_fact(n):
    P= []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

  cnt = Counter(prime_fact(n))

  ans = 0
  for c in cnt.values():
    tmp = 1
    while c >= tmp:
      c -= tmp
      ans += 1
      tmp += 1
    
  print(ans)
    
main()

Fixed submission:
from collections import Counter

def prime_fact(n):
    P= []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            P.append(i)
            n //= i
    if n != 1:
        P.append(n)
    return P

n = int(input())
cnt = Counter(prime_fact(n))

ans = 0
for c in cnt.values():
  tmp = 1
  while c >= tmp:
    c -= tmp
    ans += 1
    tmp += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import pandas as pd

df1 = pd.Dataframe([1,2])
df2 = pd.Dataframe([3,4])

print(pd.merge(df1, df2))


Fixed submission:
n = input()
if n[-1] == "3":
    print("bon")
elif n[-1] == "0" or n[-1] == "1" or n[-1] == "6" or n[-1] == "8":
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
A = list(map(int, input().split()))

Town = []
#まだ訪れていない町は-1
rec = [-1] * (n+1)
idx = 1
#すべての町を訪れるまで
while (rec[idx] == -1):
    rec[idx] = len(Town)
    Town.append(idx)
    idx = A[idx-1]

Exce = rec.index(idx)
Cycl = len(Town) - Exce

if Cycl > k:
    print(Town[k])
else:
    k -= Exce
    k %= Cycl
    print(Town[Exce+k])

Fixed submission:
S = input()
T = input()
for i in range(len(S)):
    if S[i] != T[i]:
        print("No")
        exit()
        
print("Yes")