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

Fixed submission:
a,b=map(int,input().split())
x=str(a)*b
y=str(b)*a
for i in range(len(min(x,y))):
  if x[i]<y[i]:
    print(x)
    break
  elif x[i]>y[i]:
    print(y)
    break
if x==y:
  print(x)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
x=int("str(a)"*b)
y=int("str(b)"*a)
if x<=y:
  print(y)
else:
  print(x)
Problem p02819 (python)

Fixed submission:
X=int(input())
for x in range(X,2*X):
    for i in range(2,int(x**.5)+1):
        if x%i==0:
            break
    else:
        print(x)
        break

Buggy submission (verdict: Runtime Error):
X=int(input())
for x in range(X,2*X):
    for i in range(2,int(x**.5)+1):
      if X%i==0:
        break:
      else:
        print(x)
        break

Buggy submission (verdict: Runtime Error):
X=int(input())
for x in range(X,2*X):
    for i in range(2,int(x**.5)+1):
      if X%i==0:
        break:
      else:
        print(x)
        exit()

Buggy submission (verdict: Runtime Error):
X=int(input())
for x in range(X,2*X):
    for i in range(2,int(x**.5)+1):
        if x%i!=0:
          print(x)
            break
Problem p02831 (python)

Fixed submission:
import math
A,B=map(int,input().split())
def lcm(A, B):
    return (A * B) // math.gcd(A, B)
print(lcm(A,B))

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

Fixed submission:
s = list(input())
n = len(s)
res = 0

for i in range(n//2):
    if s[i] != s[n-1-i]:
        res += 1

print(res)

Buggy submission (verdict: Runtime Error):
S=input()
A=0
for i in range(len(S):
               if S[i] != S[len(S)-1]:
               A += 1
print(A)
Problem p02847 (python)

Fixed submission:
S = input()
if S == "SUN":
  print(7)
elif S == "MON":
  print(6)
elif S == "TUE":
  print(5)
elif S == "WED":
  print(4)
elif S == "THU":
  print(3)
elif S == "FRI":
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()
if S == SUN:
  print(7)
elif S == MON:
  print(6)
elif S == TUE:
  print(5)
elif S == WED:
  print(4)
elif S == THU:
  print(3)
elif S == FRI:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()
if S == SUN:
  print(7)
if S == MON:
  print(6)
if S == TUE:
  print(5)
if S == WED:
  print(4)
if S == THU:
  print(3)
if S == FRI:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()
if S = SUN:
  print(7)
if S = MON:
  print(6)
if S = TUE:
  print(5)
if S = WED:
  print(4)
if S = THU:
  print(3)
if S = FRI:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()
if S = SUN:
  print(7)
if S = MON:
  print(6)
if S = TUE:
  print(5)
if S = WED:
  print(4)
if S = THU:
  print(3)
if S = FRI:
  print(2)
else:
  print(1)
Problem p02880 (python)

Fixed submission:
N=int(input())
A="No"
for i in range(1,10):
  for j in range(1,10):
    if i*j==N:
      A="Yes"
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
X=[]
for i in range(1,10):
  for j in range(1,10):
    X.append(i*j)
if N in X:
  print("Yes")
else:
  prinnt("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
X=[]
for i in range(1,9):
  for j in range(1,9):
    X.append(i*j)
if N in X:
  print("Yes")
else:
  prinnt("No")
Problem p02881 (python)

Fixed submission:
N=int(input())
a=10**12
for i in range(1,int(N**.5)+1):
    if N%i==0:
        a=min(a,N//i+i-2)
print(min(N,a))

Buggy submission (verdict: Runtime Error):
N=int(input())
a=10**12
for i in range(1,int(N**.5)+1):
    if N%i==0:
        a=min(a,N//n+n-2)
print(min(N,a))
Problem p02935 (python)

Fixed submission:
N=int(input())
v=sorted(map(int,input().split()))
value=v[0]
for i in range(N):
    value=(value+v[i])/2
print(value)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=sorted(map(int,input().split()))
value=v[0]
for i in range(len(N)-1):
    value=(value+v[i])/2
print(value)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=sorted(map(int,input().split()))
value=v[0]
for i in range(len(N)):
    value=(value+v[i])/2
print(value)
Problem p03208 (python)

Fixed submission:
N,K=map(int,input().split())
h=[int(input()) for i in range(N)]
h.sort()
a=10**9
for i in range(N-K+1):
  a=min(a,h[K+i-1]-h[i])
print(a)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h=[int(input()) for i in range(N)]
h.sort()
a=1000
for i in range(N-K+1):
  a=min(a,h[k+i-1]-h[i])
print(a)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h=[int(input()) for i in range(N)]
h.sort()
a=1000
for i in range(N-K):
  if h[i+K]-h[i]<a:
    a=h[i+k]-h[i]
print(a)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h=[int(input()) for i in range(N)]
h.sort()
a=1000
for i in range(N-K):
  if h[i+K]-h[i]<a:
    a=h[i+k]-h[i]
ptint(a)
Problem p03242 (python)

Fixed submission:
N=int(input())
print(1110-N)

Buggy submission (verdict: Runtime Error):
print(int(input())-N)
Problem p03250 (python)

Fixed submission:
ns=list(map(int,input().split()))
ns.sort()
print(ns[2]*10+ns[1]+ns[0])

Buggy submission (verdict: Runtime Error):
ns=list(map(int,input().split())
ns.sort()
print(ns[2]*10+ns[1]+ns[0])
Problem p03631 (python)

Fixed submission:
N=list(input())
if N[0]==N[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=list(int(input()))
if N[0]==N[2]:
  print("Yes")
else:
  print("No")
Problem p03835 (python)

Fixed submission:
r,g=map(int,input().split())
X=0
for i in range(r+1):
  for j in range(r+1):
    k=g-i-j
    if k>=0 and k<=r:
      X+=1
print(X)

Buggy submission (verdict: Runtime Error):
r,g=map(int,input().split())
X=0
for i in range(g+1):
  for j in range(g+1):
    k=g-i-j
    if k>=0 and k<=n:
      X+=1
print(X)

Buggy submission (verdict: Runtime Error):
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)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print("Yes")
else:
  print("No")
Problem p03327 (python)

Fixed submission:
N = int(input())
if N <= 999:
  print("ABC")
else:
  print("ABD")

Buggy submission (verdict: Runtime Error):
N = input()
if N <= 999:
  pirnt("ABC")
else:
  print("ABD")
Problem p02831 (python)

Fixed submission:
import fractions
A, B = [int(_) for _ in input().split()]
print(A * B // fractions.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(_) for _ in input().split()]
print(A * B // math.gcd(A, B))
Problem p02833 (python)

Fixed submission:
import sys
import math

N = int(input())
# N, K = [int(i) for i in input().split()]
if N == 0:
    print(0)
    sys.exit(0)
if N % 2 == 1:
    print(0)
    sys.exit(0)

count = 0
digit = math.ceil(math.log(N, 5))
for i in range(1, digit+1):
    x = 5 ** i
    count += (N // (x * 2))
print(count)

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

N = int(input())
# N, K = [int(i) for i in input().split()]

if N % 2 == 1:
    print(0)
    sys.exit(0)

count = 0
digit = math.ceil(math.log(N, 5))
for i in range(1, digit+1):
    x = 5 ** i
    count += (N // (x * 2))
print(count)
Problem p02835 (python)

Fixed submission:
A = [int(_) for _ in input().split()]

if sum(A) >= 22:
    print('bust')
else:
    print('win')

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

if sum(A) >= 22:
    print('bust')
else:
    print('win'
Problem p03104 (python)

Fixed submission:
import math

def cnt1(a, i):
    return (a//(2**i)) * 2**(i-1) + max(0, a%(2**i) - 2**(i-1))

A, B = [int(i) for i in input().split()]
if B == 0:
    ans = '0'
else:
    top = int(math.log2(B))+1


    ans = ''
    for i in range(1, top+1):
        cntB = cnt1(B+1, i)
        cntA = cnt1(A, i)
        ans += str((cntB-cntA)%2)

    ans = ans[::-1]
print(int(ans, 2))

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(i) for i in input().split()]
top = int(math.log2(B))+1

def cnt1(a, i):
    return (a//(2**i)) * 2**(i-1) + max(0, a%(2**i) - 2**(i-1))

ans = ''
for i in range(1, top+1):
    cntB = cnt1(B+1, i)
    cntA = cnt1(A, i)
    ans += str((cntB-cntA)%2)

ans = ans[::-1]
print(int(ans, 2))
Problem p03108 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

N, M = [int(i) for i in input().split()]
parent = [i for i in range(N+1)]
node_num = [1 for i in range(N+1)]
def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x] = find(parent[x])
        return parent[x]

bridge = []
for i in range(M):
    A, B = [int(i) for i in input().split()]
    bridge.append([A, B])

bridge = bridge[::-1]
ans_rev = [N*(N-1)//2]
combi = 0
for i in range(M-1):
    A, B = bridge[i]
    r_A = find(A)
    r_B = find(B)
    if r_A != r_B:
        parent[r_B] = r_A
        combi += node_num[r_B] * node_num[r_A]
        node_num[r_A] += node_num[r_B]
    ans_rev.append(N*(N-1)//2-combi)

ans = ans_rev[::-1]
print(*ans, sep="\n")

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(20000)
N, M = [int(i) for i in input().split()]
parent = [i for i in range(N+1)]
node_num = [1 for i in range(N+1)]
def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x] = find(parent[x])
        return parent[x]

bridge = []
for i in range(M):
    A, B = [int(i) for i in input().split()]
    bridge.append([A, B])

bridge = bridge[::-1]
ans_rev = [N*(N-1)//2]
combi = 0
for i in range(M-1):
    A, B = bridge[i]
    r_A = find(A)
    r_B = find(B)
    if r_A != r_B:
        parent[r_B] = r_A
        combi += node_num[r_B] * node_num[r_A]
        node_num[r_A] += node_num[r_B]
    ans_rev.append(N*(N-1)//2-combi)

ans = ans_rev[::-1]
print(*ans, sep="\n"

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
parent = [i for i in range(N+1)]
node_num = [1 for i in range(N+1)]
def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x] = find(parent[x])
        return parent[x]

bridge = []
for i in range(M):
    A, B = [int(i) for i in input().split()]
    bridge.append([A, B])

bridge = bridge[::-1]
ans_rev = [N*(N-1)//2]
combi = 0
for i in range(M-1):
    A, B = bridge[i]
    r_A = find(A)
    r_B = find(B)
    if r_A != r_B:
        parent[r_B] = r_A
        combi += node_num[r_B] * node_num[r_A]
        node_num[r_A] += node_num[r_B]
    ans_rev.append(N*(N-1)//2-combi)

ans = ans_rev[::-1]
print(*ans, sep="\n")
Problem p03137 (python)

Fixed submission:
#C-117
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
if n >= m:
  print(0)
elif n == 1:
  print(max(x) - min(x))
else:
  x.sort()
  x_diff = []
  for mi in range(m-1):
    x_diff.append([x[mi+1]-x[mi], mi])
  #print(x_diff)
  x_diff.sort(reverse = True)
  #print(x_diff)
  split_list = []
  for ni in range(n-1):
    split_idx = x_diff[ni][1]
    split_list.append(split_idx)
  split_list.sort()
  #print(split_list)
  #print(x)
  ans = 0
  ans += x[split_list[0]] - x[0]
  #print("ans",ans)
  for ni in range(n-2):
    l = split_list[ni]+1
    r = split_list[ni+1]
    ans += x[r] - x[l]
    #print("ans",ans)
  ans += x[-1] - x[split_list[-1]+1]
  print(ans)

Buggy submission (verdict: Runtime Error):
#C-117
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
if n >= m:
  print(0)
else:
  x.sort()
  x_diff = []
  for mi in range(m-1):
    x_diff.append(x[mi+1]-x[mi])
  #print(x_diff)
  split_list = []
  for ni in range(n-1):
    split_idx = x_diff.index(max(x_diff))
    split_list.append(split_idx)
    x_diff[split_idx] = 0
  split_list.sort()
  #print(split_list)
  #print(x)
  ans = 0
  ans += x[split_list[0]] - x[0]
  #print("ans",ans)
  for ni in range(n-2):
    l = split_list[ni]+1
    r = split_list[ni+1]
    ans += x[r] - x[l]
    #print("ans",ans)
  ans += x[-1] - x[split_list[-1]+1]
  print(ans)
Problem p03209 (python)

Fixed submission:
N, X = [int(i) for i in input().split()]
p = [1]
l = 1
for i in range(N):
    p.append(p[-1] * 2 + 1)
    l = 2 * l + 3
ban_l = 1
ban_r = l
pate = l//2+1
cnt = 0
for i in range(N+1):
    if X == pate:
        if pate == ban_l:
            cnt += 1
            break
        else:
            cnt += p[N-(i+1)] + 1
            break
    elif X == ban_l:
        break
    elif X < pate:
        ban_l = ban_l + 1
        ban_r = pate - 1
        pate = (pate+ban_l)//2
    elif X < ban_r:
        cnt += p[N-(i+1)] + 1
        ban_l = pate + 1
        pate = (pate+ban_r)//2
        ban_r = ban_r - 1
    else:
        cnt += p[N-i]
        break
print(cnt)

Buggy submission (verdict: Runtime Error):
N, X = [int(i) for i in input().split()]
b = "P"
for i in range(N):
    b = "B" + b + "P" + b + "B"

b_eat = b[:X]
print(b_eat.count("P"))
Problem p03723 (python)

Fixed submission:
a, b, c = [int(i) for i in input().split()]


if a%2 == 1 or b%2 == 1 or c%2 == 1:
    print(0)
elif a == b and b == c:
    print(-1)
else:
    x = a
    y = b
    z = c
    cnt = 0
    while True:
        if x%2 == 1 or y%2 == 1 or z%2 == 1:
            break
        else:
            x, y, z = y//2 + z//2, x//2 + z//2, x//2 + y//2
            cnt += 1

    print(cnt)

Buggy submission (verdict: Runtime Error):
a, b, c = [int(i) for i in input().split()]
if x%2 == 1 or y%2 == 1 or z%2 == 1:
    print(0)
elif a == b and b == c:
    print(-1)
else:
    x = a
    y = b
    z = c
    cnt = 0
    while True:
        if x%2 == 1 or y%2 == 1 or z%2 == 1:
            break
        else:
            x, y, z = y//2 + z//2, x//2 + z//2, x//2 + y//2
            cnt += 1

    print(cnt)
Problem p02723 (python)

Fixed submission:
S = input()
found = False
if S[2] == S[3] and S[4] == S[5]:
    found = True
if found:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p = sorted(p)
q = sorted(q)
r = sorted(r)
P = A - X
Q = B - Y
R = C - 1
found = True
for i in range(C+1):
    if R < 0:
        break
    if P < A:
        if (r[C-i-1] >= p[P]):
            if (q[Q] >= p[P]):
                P += 1
                R -= 1
            elif Q < B:
                if r[C-i-1] > q[Q]:
                    Q += 1
                    R -= 1
                else:
                    break
            else:
                break
        elif Q < B:
            if r[C-i-1] > q[Q]:
                Q += 1
                R -= 1
            else:
                break
        else:
    elif Q < B:
        if r[C-i-1] > q[Q]:
                Q += 1
                R -= 1
        else:
            break    
    else:
        break
print(sum(p[P:])+sum(q[Q:])+sum(r[R+1:]))
Problem p02729 (python)

Fixed submission:
N,M = map(int,input().split())
print(N*(N-1)//2+(M*(M-1))//2)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,S = map(int,input().split())
list = list(map(int,input().split()))
A = np.zeros((N+1,S+1,3),dtype=np.int16)
A[0][0][0] = 1

Buggy submission (verdict: Runtime Error):
A = np.zeros((N+1,S+1,3),dtype=np.int16)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,S = map(int,input().split())
list = np.int32(input().split())
A = [[[0,0,0]for i in range(S+1)]for j in range(N+1)]
A[0][0][0] = 1
for i in range(N):
    for j in range(S+1):
        A[i+1][j][0] += A[i][j][0]
        A[i+1][j][0] %= 998244353
        A[i+1][j][1] += A[i][j][0] + A[i][j][1]
        A[i+1][j][1] %= 998244353
        A[i+1][j][2] += A[i][j][0] + A[i][j][1] + A[i][j][2]
        A[i+1][j][2] %= 998244353
        if list[i] + j <= S:
            A[i+1][list[i]+j][1] += A[i][j][0] + A[i][j][1]
            A[i+1][list[i]+j][1] %= 998244353
            A[i+1][list[i]+j][2] += A[i][j][0] + A[i][j][1]
            A[i+1][list[i]+j][2] %= 998244353
print(A[N][S][2] % 998244353)

Buggy submission (verdict: Runtime Error):
H,W,K = map(int,input().split())
A = [0]*H
for i in range(H):
    A[i] = input()
s = 10000
for i in range(2**(H-1)):
    count = 0
    B = [0]*H
    for j in range(H-1):
        if (i >> j & 1):
            B[j] = 1
            count += 1
    C = [0]*(count + 1)
    for j in range(W):
        a = [0]*(count + 1)
        n = 0
        for k in range(H):
            a[n] += int(A[k][j])
            C[n] += int(A[k][j])
            if B[k] == 1:
                n += 1      
        if max(C) > K:
            count += 1
            C[:] = a[:]
    if s > count:
        s = count
print(s)
Problem p02753 (python)

Fixed submission:
a = input()
b = a[0]
c = False
for i in range(len(a)):
    if a[i] != b:
        c = True
if c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
S2 = ""
Q = int(input())
reverse = 1
for i in range(Q):
    list = input()
    if list[0] == "1":
        reverse *= -1
    else:
        if reverse == 1:
            if list[2] == "2":
                S += list[4]
            else:
                S2 += list[4]
        else:
            if list[2] == "2":
                S2 += list[4]
            else:
                S += list[4]
if reverse == 1:
    print(S2[::-1] + S)
else:
    print(S[::-1] + S2)

Buggy submission (verdict: Runtime Error):
S = input()
Q = int(input())
reverse = 1
for i in range(Q):
    list = input()
    if list[0] == "1":
        reverse *= -1
    else:
        list = list.split()
        if reverse == 1:
            if list[1] == "2":
                S = S + list[2]
            else:
                S = list[2] + S
        else:
            if list[1] == "2":
                S = list[2] + S
            else:
                S = S + list[2]
if reverse == 1:
    print(S)
else:
    print(reversed(S))

Buggy submission (verdict: Runtime Error):
a = input()
b = a[0]
c = False
for i in range(len(a)):
    if a[i] != b:
        c = True
        print("Yes")
        return
print("No")
Problem p02990 (python)

Fixed submission:
N,K = map(int,input().split())
import math
def c(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(1,K+1):
    if N-K+1>=i:
        print(c(N-K+1,i)*c(K-1,i-1)%1000000007)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
import math
def c(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(1,K+1):
    print(c(N-K+1,i)*c(K-1,i-1)%1000000007)
Problem p03011 (python)

Fixed submission:
a,b,c=map(int,input().split())
s = max(a,b,c)
print(a+b+c-s)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
List=[input() for i in range(H)]
A =[[1]*(W) for i in range(H)]
B =[[1]*(H) for i in range(W)]
for i in range(H):
    k = 0
    a = 0
    while k < W:
        if List[i][k]==".":
            a += 1
            k = k+1
        else:
            for j in range(a):
                A[i][k-j-1]=a
            A[i][k]=a
            a = 0
            k = k+1
    for j in range(a):
                A[i][k-j-1]=a
for i in range(W):
    k = 0
    a = 0
    while k < H:
        if List[k][i]==".":
            a += 1
            k = k+1
        else:
            for j in range(a):
                B[i][k-j-1]=a
            B[i][k] = 0
            a = 0
            k = k+1
    for j in range(a):
                B[i][k-j-1]= a
max = 0
for i in range(H):
    for j in range(W):
        if max < A[i][j] + B[j][i]:
            max = A[i][j] + B[j][i]
print(max-1)
Problem p02622 (python)

Fixed submission:
x=input()
y=input()
m = 0 
for i in range(len(x)):
    if x[i] != y[i]: 
        m+=1
print(m)

Buggy submission (verdict: Runtime Error):
x, y=input().split()
m = 0 
for i in range(len(x)):
    if x[i] != y[i]:
        Y = y.replace(y[i], x[i]) 
        m+=1
print(m)
Problem p03775 (python)

Fixed submission:
n=int(input())

for a in range(1,int(n**0.5+1)):
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        if a<=b:
             ans=len(sb)
        else:
            break

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
color=[]
count,free=0,0

for i in range(n):
    c=a[i]//400
    if a[i]<3200 and c not in color:
        color.append(c)
        count+=1
    elif a[i]>=3200:
        free+=1
      
min,max=0,0
if count==0:
    max=free
    min=1
else:
    max=count+free
    min=count
    
print(min,max)

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

for a in range(1,n**0.5+1):
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        if a<=b:
             ans=len(sb)
        else:
            break

print(ans)

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

for i in range(1,n//2+1):
    a=i
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        
        #print(a,b,len(sa),len(sb))
        if len(sb)-len(sa)==0:
            ans=len(sb)
            break
        elif len(sb)-len(sa)>=1:
             ans=len(sb)
        else:
            #print(b,sb,len(sa),len(sb))
            break

print(ans)

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

for i in range(1,(n)//2+1):
    a=i
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        
        #print(a,b,len(sa),len(sb))
        if len(sb)-len(sa)>=0:
            ans=len(sb)
        else:
            #print(b,sb,len(sa),len(sb))
            break

print(ans)
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
count = 0
for k in range(len(s)):
  if s[k] != t[k]:
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
count = 0
for k in range(a):
  if s[k] != t[k]:
    count += 1
    
print(count)
Problem p02659 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=float(b)*1000
b=int(b)
print(int((a*b)//1000))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

a, b = input().split()
a = int(a)
b_100  = Decimal(b * 100)
print(int(a * b_100 // 100))

Buggy submission (verdict: Runtime Error):
a, b =input().split()
a = int(a)
b_100 = round(100 * b)
times = a * b_100
new_times = times / 100
print(new_times)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(float, input().split())
times = 0
a = int(a)
b = round(math.float(100 * b))
times = a * b
new_times = times / 100
print(new_times)

Buggy submission (verdict: Runtime Error):
import math


a, b = map(float, input().split())
times = 0
a = int(a)
b = int(math.floot(100 * b))
times = a * b
new_times = times / 100
print(new_times)

Buggy submission (verdict: Runtime Error):
import math


a, b = map(float, input().split())
times = 0
a = int(a)
b = int(math.float(100 * b))
times = a * b
new_times = times / 100
print(new_times)

Buggy submission (verdict: Runtime Error):
import math


a, b = map(float, input().split())
times = 0
if a == 0 or b == 0:
    print(0)
else:
    for k in range(0, a):
        times += b
    new_times = math.floor(times)
    print(new_times)

Buggy submission (verdict: Runtime Error):
import math

a, b = map(float, input().split())
c = int(a)
times = c * b
new_times = math.floar(times)
print(int(new_times))
Problem p02785 (python)

Fixed submission:
n, k = map(int, input().split())
h = sorted(map(int, input().split()))
 
x = 0

if n - k <= 0:
    print(0)
else:
    for i in range(n-k):
        x += h[i]
    print(x)

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

H_sort = sorted(H, reverse=True)

if N <= K:
    print(0)
    quit()
for i in range(K):
    del H_sort[i]

print(sum(H_sort))

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

H_sort = sorted(H, reverse=True)

for i in range(K):
    del H_sort[i]

print(sum(H_sort))
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int, input().split())
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)
 
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))