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

Fixed submission:
a = int(raw_input().strip())
b = int(raw_input().strip())
c = int(raw_input().strip())
d = int(raw_input().strip())

print min(a, b) + min(c, d)

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

h, w = 100, 100
lines = []

orig_a = a

while a > 50:
    lines.append(list(".#" * 50))
    lines.append(list("#" * 100))
    a -= 50

if a > 1:
    left = ".#" * (a - 1)
    right = "#" * (100 - len(left))
    lines.append(list(left + right))
    lines.append(list("#" * 100))

while len(lines) < 100:
    lines.append(list("." * 100))

if orig_a != 1:
    b -= 1
cl = 99

while b > 49:
    for i in xrange(50):
        lines[cl][2 * i] = "#"
    b -= 50
    cl -= 2

if b > 0:
    for i in xrange(b):
        lines[cl][2 * i] = "#"

print h, w
for line in lines:
    print "".join(line)
Problem p03504 (python)

Fixed submission:
from heapq import heappop as pop, heappush as push

peak, curr = 0, 0

stuff = []
n, c = map(int, raw_input().split())
for _ in xrange(n):
  stuff.append(map(float, raw_input().split()))
  stuff[-1][-1] = int(stuff[-1][-1]) - 1
  
stuff = sorted(stuff)
has_camera = [False] * c
last_ending = [-1] * c
ending = []
for st, end, ch in stuff:
  while ending and ending[0][0] <= st - 0.5:
    cend, cch = pop(ending)
    if last_ending[cch] == cend:
        has_camera[cch] = False
        curr -= 1
  if not has_camera[ch]:
    has_camera[ch] = True
    curr += 1
  push(ending, (end, ch))
  last_ending[ch] = end
  peak = max(peak, curr)
  
print peak

Buggy submission (verdict: Runtime Error):
from heapq import heappop as pop, heappush as push

peak, curr = 0, 0

stuff = []
n, c = map(int, raw_input().split())
for _ in xrange(n):
  stuff.append(map(float, raw_input().split()))
  
stuff = sorted(stuff)
has_camera = [False] * c
ending = []
for st, end, ch in stuff:
  while ending[0][0] <= st - 0.5:
    _, cch = pop(ending)
    has_camera[cch] = False
    curr -= 1
  if not has_camera[ch]:
    curr += 1
  push(ending, (end, ch))
  peak = max(peak, curr)
  
 print peak
Problem p03733 (python)

Fixed submission:
def sol(t, tis):
    flow = 0
    ret = 0
    for ti in tis:
        ret += min(ti + t - flow, t)
        flow = ti + t

    return ret


if __name__ == "__main__":
    n, t = map(int, raw_input().strip().split())
    tis = map(int, raw_input().strip().split())
    print sol(t, tis)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict as dd
from itertools import izip


def sol(n, w, wis, vis):
    rv = 0
    best = dd(int)
    for i, (wi, vi) in enumerate(izip(wis, vis)):
        if wi < w:
            best[(wi, i)] = max(best[(wi, i)], vi)
            rv = max(vi, rv)

    frontline = [(i, wis[i], vis[i]) for i in xrange(n - 1, -1, -1)]
    while frontline:
        last, cw, cv = frontline.pop()
        for i in xrange(last + 1, n):
            nw, nv = cw + wis[i], cv + vis[i]
            if nw <= w and best[(nw, i)] < nv:
                best[(nw, i)] = nv
                frontline.append((i, nw, nv))
                rv = max(rv, nv)

    return rv


if __name__ == "__main__":
    n, w = map(int, raw_input().strip().split())
    wis, vis = [], []
    for _ in xrange(n):
        wi, vi = map(int, raw_input().strip().split())
        wis.append(wi)
        vis.append(vi)
    print sol(n, w, wis, vis)
Problem p02681 (python)

Fixed submission:
userData = input()

userDatas = input()

if userData == userDatas[0:-1]:
  print("Yes")
else:
  print("No")

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

userDatas = input()

if userData == useDatas[0:-1]:
  print("Yes")
else:
  print("No")
Problem p02783 (python)

Fixed submission:
n,m=map(int,input().split())
ans=float
ans=n/m
if ans == 0:
    print(1)
elif ans == int(ans):
    print(int(ans))
else:
    print(int(ans)+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=int
ans=n/m
print(int(ans)+1)
Problem p02678 (python)

Fixed submission:
N,M = map(int,input().split())
ans = {i:0 for i in range(1,N+1)}
ans[1] = 10000000
route = {i:set() for i in range(1,N+1)}
for _ in range(M):
    a,b = map(int,input().split())
    route[a].add(b)
    route[b].add(a)
x = {1}
for _ in range(N+1):
    tmp = set()
    count = 0
    for i in x:
        for j in route[i]:
            #print(j)
            if ans[j] == 0:
                ans[j] = i
                count += 1
                tmp.add(j)
    x = tmp
    #print(ans,x)
    if count == 0:
        break
check = 0
for i in ans.keys():
    if i != 1:
        if ans[i] == 0:
            check = 1
if check == 1:
    print('No')
else:
    print('Yes')
    for i in ans.keys():
        if i != 1:
            print(ans[i])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
ans = {i:0 for i in range(1,N+1)}
ans[1] = 10000000
route = {i:[] for i in range(1,N+1)}
for _ in range(M):
    a,b = map(int,input().split())
    route[a].append(b)
    route[b].append(a)
x = [1]
for _ in range(M):
    for i in x:
        tmp = []
        for j in route[i]:
            #print(j)
            count = 0
            if ans[j] == 0:
                ans[j] = i
                count += 1
            tmp.append(j)
    x = tmp
    #print(ans,x)
    if count = 0:
        break
print('Yes')
for i in ans.keys():
    if i != 1:
        print(ans[i])
Problem p02804 (python)

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
mod = p = 10 ** 9 + 7

fact = [1]
fact_inv = [1]
for i in range(10**5+5):
    new_fact = fact[-1]*(i+1)%mod
    fact.append(new_fact)
    fact_inv.append(pow(new_fact,mod-2,mod))
 
 
def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod    

A_max = 0
A_min = 0
for i in range(N-K+1):
    A_max = (A_max + (A[(K-1)+i] * mod_comb_k((K+i-1),i,p))) % p   
    A_min = (A_min + (A[-1*(K+i)] * mod_comb_k((K+i-1),i,p))) % p
    #print(A_max,A_min,cmb((K+i),i,p))
ans = (A_max - A_min)
if ans < 0:
    ans = p + ans
ans %= p
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
MOD = 10 ** 9 + 7
A_max = A[K-1]
A_min = A[-K]
x = 1
count = 1
ans = A_max - A_min
for i in range(K,N):
    x = x * i // count
    #x %= MOD
    count += 1
    #print(x,i,count)
    A_tmp = (A[i] - A[-1*i-1])* x) 
    #print(A_max,A_min)
    ans = (ans + A_tmp) % MOD
print(ans)
Problem p02806 (python)

Fixed submission:
N = int(input())
st = []
for i in range(N):
    s = list(map(str,input().split()))
    st.append(s)
X = input()
check = 0
ans = 0
for i in st:
    if check == 1:
        ans += int(i[1])
    if i[0] == X:
        check = 1
print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    X = tuple(map(int,input().split()))
    MOD = 10 ** 9 + 7
    goal = X[-1]
    ans = goal - X[0]
    x = 1
    count = 2
    for i in X[1:N-1]:
       tmp = goal - i
       ans = ((ans * count % MOD) + ((x*tmp)%MOD)) % MOD
       x *= count % MOD
       count += 1
    print(ans)
if __name__ == '__main__':
    main()
Problem p02838 (python)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
mod = 10 ** 9 + 7
ans = 0
m = 1
for _ in range(60):
    bit = sum(a & m for a in x) #フラグが立ってる桁を合計
    bit //= m #1の個数を数えるためにmで割る
    non_bit = n - bit #0の個数を出す
    ans = (ans + bit * non_bit * m) % mod #桁の合計出す
    m <<= 1 #桁を1増やす
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
mod = 10 ** 9 + 7
ans = 0
m = 1　#1の桁のbitからスタート
for _ in range(60):
    bit = sum(a & m for a in x) #フラグが立ってる桁を合計
    bit //= m #1の個数を数えるためにmで割る
    non_bit = n - bit #0の個数を出す
    ans = (ans + bit * non_bit * m) % mod #桁の合計出す
    m <<= 1 #桁を1増やす
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
mod = 10 ** 9 + 7
a = [list(bin(int(i))[2:].zfill(60)) for i in input().split()]
a = np.array(a)
x = a.T
x = x.tolist()
#print(x)
ans = 0
for i in range(60):
    y = x[i].count('0')
    z = x[i].count('1')
    tmp = ( (n * (n - 1) // 2) - (y * (y - 1) // 2) - (z * (z - 1) // 2) ) % mod
    tmp2 = 1
    for j in range(60 - i - 1):
        tmp2 = tmp2 * 2 % mod
    #print(tmp,tmp2)
    
    ans = (ans + tmp2 * tmp) % mod
print(ans)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]

ans = 0
max = 0
T = H[0]
for i in range(N-1):
    if H[i] >= H[i+1]:
        ans += 1
        if ans >= max :
            max = ans
    
    else:
        ans = 0
        

print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [int(i) for i in input().split()]

ans = 0
max = 0
T = H[0]
for i in range(N-1):
    if H[i] >= H[i+1]:
        ans + = 1
        if ans >= max :
            max = ans
    
    else:
        ans = 0
        

print(max)
Problem p02947 (python)

Fixed submission:
N = int(input())
X =[]
for i in range(N):
    Y =list(input())
    Y.sort()
    X.append(Y)
X.sort()
    
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1
            Z = Z * count * (count-1)
            Z = Z // 2
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1
    Z = Z * count * (count-1)
    Z = Z // 2
    ans = ans + Z
        
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X =[]
LIST = ["0","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"]
B = 0
for i in range(N):
    Y =list(input())
    for i in range(10):
        
        A = LIST.index(Y[i])
        B = B + 10 ** A
    X.append(B)
    B = 0
X.sort()
#print(X)
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1/2
            for i in range(1,count+1):
                Z = Z * i
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1/2
    for i in range(1,count+1):
        Z = Z * i
    ans = ans + Z
        
print(int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
X =[]
for i in range(N):
    Y =list(input())
    Y.sort()
    X.append(Y)
X.sort()
    
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1/2
            for i in range(1,count+1):
                Z = Z * i
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1/2
    for i in range(1,count+1):
        Z = Z * i
    ans = ans + Z
        
print(int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
X =[]
for i in range(N):
    Y =list(input())
    Y.sort()
    X.append(Y)
    X.sort()
    
ans = 0
count = 1 
for i in range(N-1):
    if X[i] == X[i+1]:
        count += 1
    else:
        if count != 1:
            Z = 1/2
            for i in range(1,count+1):
                Z = Z * i
            ans = ans + Z
            count = 1

if count != 1:
    Z = 1/2
    for i in range(1,count+1):
        Z = Z * i
    ans = ans + Z
        
print(int(ans))
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
e = c * d // fractions.gcd(c,d)

c_count = b // c - (a - 1) // c
d_count = b // d - (a - 1) // d
e_count = b // e - (a - 1) // e

ans = b - a + 1 - c_count - d_count + e_count
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = (int(i) for i in input().split())

X = (C * D) // math.gcd(C, D)
Y = (C + D) // math.gcd(C, D) - 1

#print(X,Y)

#count = (B - A) // X * Y 
#print(count)


N = A % X 
N_S = N-1
UA = Y - (N_S // C + N_S // D)

#print(UA)
M = B % X
UB = M // C + M // D
if M == 0:
    UB = 0
#print(UB)


SA =  A + ( X - N )
SB =  B - M 
#print(SA,SB)
count = (SB - SA) // X * Y 

#print(count)
add = count + UA + UB
    
Z = B - A - add + 1
print(Z)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = (int(i) for i in input().split())

X = (C * D) // math.gcd(C, D)
Y = (C + D) // math.gcd(C, D) - 1

print(X,Y)

#count = (B - A) // X * Y 
#print(count)


N = A % X 
N_S = N-1
UA = Y - (N_S // C + N_S // D)

print(UA)
M = B % X
UB = M // C + M // D
if M == 0:
    UB = 0
print(UB)


SA =  A + ( X - N )
SB =  B - M 
print(SA,SB)
count = (SB - SA) // X * Y 

print(count)
add = count + UA + UB
    
Z = B - A - add + 1
print(Z)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = (int(i) for i in input().split())

X = (C * D) // math.gcd(C, D)
Y = (C + D) // math.gcd(C, D) - 1

#print(X,Y)

#count = (B - A) // X * Y 
#print(count)


N = A % X 
N_S = N-1
UA = Y - (N_S // C + N_S // D)

#print(UA)
M = B % X
UB = M // C + M // D
if M == 0:
    UB = 0
#print(UB)


SA =  A + ( X - N )
SB =  B - M 
#print(SA,SB)
count = (SA - SB) // X * Y 

add = count + UA + UB
    
Z = B - A - add + 1
print(Z)
Problem p03071 (python)

Fixed submission:
A,B=(int(x) for x in input().split())

if A == B:
    COINS=2*A
    
elif A > B:
    COINS=2*A-1

else:
    COINS=2*B-1

print(COINS)

Buggy submission (verdict: Runtime Error):
N = input()
H = [s for s in input().split()]

HIEST = H[0]
COUNT = 0
for i in H:

    if i >= HIEST:
        HIEST = i
        COUNT = COUNT+1

print(COUNT)
Problem p03150 (python)

Fixed submission:
s = input()
t = 'keyence'
ans = 0
flag = False
for i in range(len(s)):
    for j in range(i,len(s)):
        tmp = s[:i] + s[j:]
        if tmp == t:
            ans = 1
            flag = True
            break
    if flag:
        break
if ans == 1:
    print('YES')
else:
    print('NO')

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

check = 0
re = 0
t = 'keyence'
len = 0
ans = 0
for i in s:
    if t[len] == i and len < 7:
        len += 1
        re = 0
    else:
        if check == 0:
            check = 1
            re = 1
        elif re == 1:
            tmp = 1
        else:
            ans = 1

if ans == 0 and len == 7:
    print('YES')
else:
    print('NO')
Problem p03227 (python)

Fixed submission:
S = str(input())

if len(S) == 2:
    print(S)
    
else:
    A = list(reversed(S))
    print(''.join(A))

Buggy submission (verdict: Runtime Error):
S = str(input())

if len(S) == 2:
    print(S)
    
else:
    print(''.join(A))
Problem p03292 (python)

Fixed submission:
A1,A2,A3 =(int(i) for i in input().split())

x = abs(A1-A2)
y = abs(A2-A3)
z = abs(A3-A1)

N = [x,y,z]
N.sort()
ans = N[0] + N[1]
print(ans)

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

X = [ abs(A[0] - A[1]),abs(A[1] - A[2]),abs(A[0] -A[2])]

X = X.sort()
ans = X[1] + X[2]
print(ans)
Problem p03474 (python)

Fixed submission:
A,B = (int(i) for i in input().split())
S = str(input())
if S[A] != "-" or "-" in S[:A] or "-" in S[-B:]:
    print('No')

else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split())
S = str(input())

if S[A] !== '-' or S[:A]in '-' or S[A+1:] in '-'or len(S) != A + B + 1:
    print('No')

else:
    print('Yes')
Problem p03545 (python)

Fixed submission:
X = input()
flag = ['+','-']
check = 0
for i in flag:
    if check == 1:
        break
    for j in flag:
        if check == 1:
            break
        for k in flag:
            ans = 0
            if i == '+':
                ans = int(X[0]) + int(X[1])
            else:
                ans = int(X[0]) - int(X[1])
            if i == '+':
                ans = int(X[0]) + int(X[1])
            else:
                ans = int(X[0]) - int(X[1])
            if j == '+':
                ans += int(X[2])
            else:
                ans -= int(X[2])
            if k == '+':
                ans += int(X[3])
            else:               
                ans -= int(X[3])
            if ans == 7:
                anslist = [X[0],i,X[1],j,X[2],k,X[3],'=','7']
                check = 1
print(''.join(anslist))

Buggy submission (verdict: Runtime Error):
X = input()
flag = ['+','-']
check = 0
for i in flag:
    if i == '+':
        ans = int(X[0]) + int(X[1])
    else:
        ans = int(X[0]) - int(X[1])
    if check == 1:
        break
    for j in flag:
        if j == '+':
            ans += int(X[2])
        else:
            ans -= int(X[2])
        if check == 1:
            break
        for k in flag:
            if k == '+':
                ans += int(X[3])
            else:
                ans -= int(X[3])
            if ans == 7:
                anslist = [X[0],i,X[1],j,X[2],k,X[3],'=','7']
                check = 1
            if check == 1:
                break
print(''.join(anslist))

Buggy submission (verdict: Runtime Error):
X = input()
flag = ['+','-']
for i in flag:
    if i == '+':
        ans = int(X[0]) + int(X[1])
    else:
        ans = int(X[0]) - int(X[1])
    for j in flag:
        if j == '+':
            ans += int(X[2])
        else:
            ans -= int(X[2])
        for k in flag:
            if k == '+':
                ans += int(X[3])
            else:
                ans -= int(X[3])
            if ans == 7:
                anslist = [X[0],i,X[1],j,X[2],k,X[3],'=','7']
print(''.join(anslist))

Buggy submission (verdict: Runtime Error):
X = input()
flag = ['+','-']
for i in flag:
    if i == '+':
        ans = int(X[0]) + int(X[1])
    else:
        ans = int(X[0]) - int(X[1])
    for j in flag:
        if j == '+':
            ans += int(X[2])
        else:
            ans -= int(X[2])
        for k in flag:
            if k == '+':
                ans += int(X[3])
            else:
                ans -= int(X[3])
            if ans == 7:
                anslist = [X[0],i,X[1],j,X[2],k,X[3]]
print(''.join(anslist))
Problem p03612 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    if P[i] == i + 1:
        P[i],P[i+1] = P[i+1],P[i]
        ans += 1
if P[-1] == N:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    if P[i] == i + 1:
        P[i],P[i+1] = P[i+1],P[i]
        ans += 1
print(ans)
Problem p03651 (python)

Fixed submission:
import fractions
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
mx = a[-1]
if mx < k:
    ans = 'IMPOSSIBLE'
elif n == 1:
    if a[0] == k:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
else:
    gcd = fractions.gcd(a[0],a[1])
    for i in range(0,n):
        gcd = fractions.gcd(gcd,a[i])
    if k % gcd == 0:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
mx = a[-1]
if mx < k:
    ans = 'IMPOSSIBLE'
else:
    gcd = fractions.gcd(a[0],a[1])
    for i in range(2,n):
        gcd = fractions.gcd(gcd,a[i])
    if k % gcd == 0:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
mx = a[-1]
if mx < k:
    ans = 'IMPOSSIBLE'
else:
    gcd = fractions.gcd(a[0],a[1])
    for i in range(2,n):
        tmp_gcd = fractions.gcd(gcd,a[i])
        if tmp_gcd < gcd:
            gcd = tmp_gcd
    if k % gcd == 0:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
print(ans)
Problem p03679 (python)

Fixed submission:
X,A,B = (int(i) for i in input().split())
Y = A - B
if Y >= 0:
    print('delicious')

elif (-1) * Y <= X :
    print('safe')
    
else:
    print('dangerous')

Buggy submission (verdict: Runtime Error):
X,A,B = (int(i) for i in input().split())
Y = A - B
if Y >= 0:
    print('delicious')

elif (-1) * Y =< X :
    print('safe')
    
else:
    print('dangerous')
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a + a**2 + a**3)

Buggy submission (verdict: Runtime Error):
a = map(int,input())
print(a + a**2 + a**3)
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C = [int(x) for x in input().split()]
R = sorted([int(x) for x in input().split()],reverse = True)[:X]
G = sorted([int(x) for x in input().split()],reverse = True)[:Y]
CL = sorted([int(x) for x in input().split()],reverse = True)[:X+Y]
total = sorted(R+G+CL, reverse=True)[:X+Y]
print(sum(total))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C = [int(x) for x in input().split()]
R = [int(x) for x in input().split()]
G = [int(x) for x in input().split()]
CL = [int(x) for x in input().split()]

dp = [[0]*(X+1) for d in range(Y+1)]
for i in range(X):
    for j in range(Y):
        MAX = max(max(R[j],CL[j]),max(G[i],CL[i]))
        dp[i][j] = MAX
        if MAX == R[j]:
            A.pop(0)
        elif MAX == G[i]:
            B.pop(0)
        else:
            C.pop(0)

print(dp[-1])
Problem p02657 (python)

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

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

def factorize(n):
    b = 2
    fct = []

    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    
    if n > 1:
        fct.append(n)
    
    return fct

N = int(input())
f = factorize(N)
dic = dd(int)

for val in f:
    if val != 1:
        dic[val] += 1
res = 0

ls = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66]

for val in dic.values():
    tmp = bisect.bisect_right(ls, val)
    res += tmp

print(res)
Problem p02639 (python)

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

if X[0]==0:
  print(1)
elif X[1] == 0:
  print(2)
elif X[2] == 0:
  print(3)
elif X[3] == 0:
  print(4)
else:
  print(5)

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

if X[0]==0:
  print(1)
 elif X[1] == 0:
    print(2)
 elif X[2] == 0:
    print(3)
 elif X[3] == 0:
    print(4)
 else:
    print(5)

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

if X[0]==0:
  print(1)
  elif X[1] == 0:
    print(2)
    elif X[2] == 0:
      print(3)
      elif X[3] == 0:
        print(4)
        else:
          print(5)
Problem p02657 (python)

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

print(X[0]*X[1])

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

print(X[0]*X[1])
Problem p02700 (python)

Fixed submission:
MON = list(map(int,input().split()))
 
while 1:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break
 
  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break

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

While True:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break

  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break
Problem p02789 (python)

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

if n == m:
    print("Yes")
else:
    print("No")

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

if n / m == 1:
    print("Yes")
else:
    print("No")
Problem p03331 (python)

Fixed submission:
n = int(input())

s = []
for i in range(1, n):
    j = n - i
    if i + j == n:
        a = sum(map(int, str(i)))
        b = sum(map(int, str(j)))
        s.append(a + b)
print(min(s))

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

s = []
for i in range(2, n + 1):
    j = n - i
    if j >= 2 and i + j == n:
        a = sum(map(int, str(i)))
        b = sum(map(int, str(j)))
        s.append(a + b)
print(min(s))
Problem p03339 (python)

Fixed submission:
n = int(input())
s = list(map(str, input()))
a = []
cnt = s.count("E")
s.insert(0, 0)
s.append(0)
for i in range(1, n + 1):
    if s[i - 1] == "W":
        cnt += 1
    if s[i] == "E" and cnt != 0:
        cnt -= 1
    a.append(cnt)
print(min(a))

Buggy submission (verdict: Runtime Error):
a = []
cnt = s.count("E")
s.insert(0, 0)
s.append(0)
for i in range(1, n + 1):
    if s[i - 1] == "W":
        cnt += 1
    if s[i] == "E" and cnt != 0:
        cnt -= 1
    a.append(cnt)
print(min(a))
Problem p03423 (python)

Fixed submission:
a = int(raw_input())
m = int(a / 3)
print(m)

Buggy submission (verdict: Runtime Error):
a = int(imput())
m = int(a / 3)
print(m)