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

Fixed submission:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

N, M, K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a, b=[0], [0]
for i in range(N):
	a.append(a[i]+A[i])
for i in range(M):
	b.append(b[i]+B[i])
	
ans, j=0, M
for i in range(N+1):
	if a[i] > K :
		break
	while b[j] > K - a[i]:
		j-=1
	ans=max(ans, i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

n , m , k = map(int , input().split())
a = list(map(int , input().split()))
b = list(map(int , input().split()))
i = 0
j = 0
ans = 0
while k:
	#print(k,i,j,ans)
	f = 1
	if i < n and a[i] < b[j]:
		if k - a[i] >= 0:
			k-=a[i]
			ans+=1
			i+=1
			f = 0
			if i == n: i = n-1
	elif j < m and b[j] < a[i]:
		if k - b[j] >= 0:
			k-=b[j]
			ans+=1
			j+=1
			f = 0
	if f: break
	if i >= n  and j >= m: break
print(ans)
Problem p02624 (python)

Fixed submission:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline
sys.setrecursionlimit(10**6)
########################################
mxn =  10**7
divs = [0]*(mxn + 11)
for i in range(1,mxn+1):
	for j in range(0, mxn+1,i):
		divs[j]+=1

n = int(input())
ans = 0
for i in range(1,n+1):
	ans+=i*divs[i]
print(ans)

Buggy submission (verdict: Runtime Error):
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline
from numba import*
########################################
@njit('i8(i8)',cache=1)
def main():
	mxn =  10**7
	divs = [0]*(mxn + 11)
	for i in range(1,mxn+1):
		for j in range(0, mxn+1,i):
			divs[j]+=1

	n = int(input())
	ans = 0
	for i in range(1,n+1):
		ans+=i*divs[i]
	print(ans)


main()
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
a, b = map(Decimal, input().split())
#print(a*b)
c = a*b
c = int(c)
print(c)

Buggy submission (verdict: Runtime Error):

a, b = map(float, input().split())
print(math.floor(a*b))
Problem p02712 (python)

Fixed submission:
mxn = 10**6 + 11
arr = []
for i in range(1,mxn):
    if i % 3 == 0 and i % 5 == 0:
        arr.append(0)
    elif i % 3 == 0:
        arr.append(0)
    elif i%5 == 0:
        arr.append(0)
    else:
        arr.append(i)

n = int(input())
print(sum(arr[:n]))

Buggy submission (verdict: Runtime Error):
mxn = 10**6 + 11
arr = []
for i in range(1,mxn):
    if i % 3 == 0 and i % 5 == 0:
        arr.append(0)
    elif i % 3 == 0:
        arr.append(0)
    elif i%5 == 0:
        arr.append(0)
    else:
        arr.append(i)

n = int(input())
print(sum[:n])
Problem p02753 (python)

Fixed submission:
s = list(input())
if len(set(s)) == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import math
n , a , b  = map(int, input().split())
if b == 0: exit(print(n))
if a >= n : exit(print(n))
if a == 0: exit(print(0))
ans = n//(a+b)
#print("ans",ans)
print(ans*a+(n-ans*a-ans*b))

Buggy submission (verdict: Runtime Error):
import math
n , a , b  = map(int, input().split())
if a >= n : exit(print(n))
if a == 0: exit(print(0))
ans = n//(a+b)
#print("ans",ans)
print(ans*a+(n-ans*a-ans*b))

Buggy submission (verdict: Runtime Error):
import math
n , a , b  = map(int, input().split())
if a >= n : exit(print(n))
ans = n//(a+b)
#print("ans",ans)
print(ans*a+(n-ans*a-ans*b))

Buggy submission (verdict: Runtime Error):
import math
n , a , b  = map(int, input().split())
if a >= n : exit(print(n))
ans = n//(a+b)
#print("ans",ans)
print(ans*a+(n-ans*a-ans*b))

Buggy submission (verdict: Runtime Error):
import math
n , a , b  = map(int, input().split())
if a >= n : exit(print(n))
ans = n/(a+b)
print(math.floor(ans*a))
Problem p02550 (python)

Fixed submission:
N,X,M=map(int,input().split())
l=[X]
p=[-1]*(M+1)
p[X]=0
x=0
for i in range(N-1):
    x=(l[-1]**2)%M
    if p[x]>=0:
        break
    l.append(x)
    p[x]=i+1
x=p[x]
y=len(l)-x
print(sum(l[:x])+(N-x)//y*sum(l[x:])+sum(l[x:x+(N-x)%y]))

Buggy submission (verdict: Runtime Error):
N,X,M=map(int,input().split())
l=[X]
p=[-1]*(M+1)
p[X]=0
for i in range(N-1):
    x=(l[-1]**2)%M
    if p[x]>=0:
        break
    l.append(x)
    p[x]=i+1
x=p[x]
y=len(l)-x
print(sum(l[:x])+(N-x)//y*sum(l[x:])+sum(l[x:x+(N-x)%y]))

Buggy submission (verdict: Runtime Error):
N,X,M=map(int,input().split())
l=[X]
p=[-1]*M
p[X]=0
for i in range(N-1):
    x=(l[-1]**2)%M
    if p[x]>=0:
        break
    l.append(x)
    p[x]=i+1
if i==N-2:
    print(sum(l))
else:
    x=p[x]
    y=len(l)-x
    print(sum(l[:x])+(N-x)//y*sum(l[x:])+sum(l[x:x+(N-x)%y]))
Problem p02598 (python)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
l,r=1,10**9+1
while r-l>1:
    t=(l+r)//2
    k=sum([(a+t-2)//(t-1)-1 for a in A])
    if K<k:
        l=t
    else:
        r=t
print(l)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
l,r=0,10**9+1
while r-l>1:
    t=(l+r)//2
    k=sum([(a+t-2)//(t-1)-1 for a in A])
    if K<k:
        l=t
    else:
        r=t
print(l)
Problem p02695 (python)

Fixed submission:
N,M,Q=map(int,input().split())
ABCD=[list(map(int,input().split())) for i in range(Q)]
from itertools import combinations
ans=0
for p in combinations(range(N+M-1),N):
    r=0
    for a,b,c,d in ABCD:
        if p[b-1]-b+1-(p[a-1]-(a-1))==c:
            r+=d
    ans=max(ans,r)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M,Q=map(int,input().split())
ABCD=[list(map(int,input().split())) for i in range(Q)]
from itertools import combinations
ans=0
for p in combinations(range(N+M),M):
    r=0
    for a,b,c,d in ABCD:
        if p[b-1]-b+1-p[a-1]+a-1==c:
            r+=d
    ans=max(ans,r)
print(ans)
Problem p02781 (python)

Fixed submission:
N=input()
K=int(input())
l=len(N)
dp=[[0]+[1]*l]+[[0]*(l+1) for i in range(K)]
dp2=[[1]+[0]*l]+[[0]*(l+1) for i in range(K)]
for i,n in enumerate(N):
    n=int(n)
    for j in range(K):
        dp[j+1][i+1]=dp[j][i]*9+dp[j+1][i]+(dp2[j][i]*(n-1)+dp2[j+1][i] if n>0 else 0)
        dp2[j+1][i+1]=dp2[j][i] if n>0 else dp2[j+1][i]
print(dp[-1][-1]+dp2[-1][-1])

Buggy submission (verdict: Runtime Error):
N=input()
K=int(input())
l=len(N)
dp=[[0]*(l+1) for i in range(K+1)]
dp[0][0]=1
x=0
for i,n in enumerate(N):
    n=int(n)
    dp[0][i+1]=1
    if n==0:
        for j in range(1,K+1):
            dp[j][i+1]=dp[j][i]+dp[j-1][i]*9
    else:
        for j in range(1,K+1):
        dp[j][i+1]=dp[j][i]+dp[j-1][i]*9 if i-j>-1 else 0 if i-j<-1 else n if i==0 else (dp[j-1][i]-1)*9+n
print(dp[-1][-1])
Problem p02948 (python)

Fixed submission:
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
r=0
from heapq import heappop,heappush
q=[]
l=[[] for i in range(10**5)]
for a,b in AB:
    l[a-1].append(b)
for i in range(M):
    for e in l[i]:
        heappush(q,-e)
    if len(q)>0:
        r+=-heappop(q)
print(r)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
AB=sorted([list(map(int,input().split())) for i in range(N)],key=lambda x: (-x[1],x[0]))
r=0
on=[-1]*M
def put(i):
    r=0
    if i<0:
        return -1
    if on[i]<0:
        if i==0:
            if on[i]==-1:
                on[i]=-2
            else:
                r=-1
        elif on[i-1]==-1:
            on[i]=i-1
        else:
            on[i]=on[i-1]
    else:
        r=put(on[i])
    return r
for a,b in AB:
    x=put(M-a)
    if x!=-1:
        r+=b
print(r)
Problem p03033 (python)

Fixed submission:
N,Q=map(int,input().split())
import sys
def input(): return sys.stdin.readline().strip()
STX=[list(map(int,input().split())) for i in range(N)]
D=[int(input()) for i in range(Q)]
X=[]
for s,t,x in STX:
    X.append((s-x,1,x))
    X.append((t-x,-1,x))
X.sort(key=lambda x:x[0])
a=0
k=[]
from heapq import heappop,heappush
kd={}
for x in X:
    while a<Q and D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
    if x[1]==1:
        heappush(k,x[2])
        if x[2] in kd:
            kd[x[2]]=0
    else:
        kd[x[2]]=1
        while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k)
while a<Q:
    print(-1)
    a+=1

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
import sys
def input(): return sys.stdin.readline().strip()
STX=[list(map(int,input().split())) for i in range(N)]
D=[int(input()) for i in range(Q)]
X=[]
for s,t,x in STX:
    X.append((s-x,1,x))
    X.append((t-x,-1,x))
X.sort(key=lambda x:x[0])
a=0
k=[]
from bisect import bisect_left
for x in X:
    while D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
    if x[1]==1:
        i=bisect_left(k,x[2])
        k.insert(i,x[2])
    else:
        i=bisect_left(k,x[2])
        del k[i]
while a<Q:
    print(-1)
    a+=1
Problem p03038 (python)

Fixed submission:
N,M=map(int, input().split())
import sys
def input(): return sys.stdin.readline().strip()
A=list(map(int, input().split()))
BC=[list(map(int,input().split())) for i in range(M)]
A.sort()
BC.sort(key=lambda x: x[1],reverse=True)
from bisect import bisect_left
ans=0
l=0
for m in range(M):
    if BC[m][0]<len(A)-l and A[BC[m][0]+l]<BC[m][1]:
        ans=ans+BC[m][1]*BC[m][0]
        l+=BC[m][0]
    else:     
        r=bisect_left(A[l:],BC[m][1])
        if r:
            ans=ans+BC[m][1]*r
            l+=r
        break
ans+=sum(A[l:])
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
import sys
def input(): return sys.stdin.readline().strip()
A=list(map(int, input().split()))
BC=[list(map(int,input().split())) for i in range(M)]
A.sort()
BC.sort(key=lambda x: x[1],reverse=True)
from bisect import bisect_left
ans=0
for m in range(M):
    if A[BC[m][0]]<BC[m][1]:
        ans=ans+BC[m][1]*BC[m][0]
        A=A[BC[m][0]:]
    else:    
        r=bisect_left(A,BC[m][1])
        ans=ans+BC[m][1]*r
        A=A[r:]
ans+=sum(A)
print(ans)
Problem p03053 (python)

Fixed submission:
h,w=map(int, input().split())
a=[input() for i in range(h)]

from collections import deque
b=[[0]*w for i in range(h)]
q=deque()
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            q.append((i,j))
            b[i][j]=1
ans=-1
while len(q)>0:
    ans+=1
    q2=deque()
    for i,j in q:
        if j>0 and b[i][j-1]==0:
            q2.append((i,j-1))
            b[i][j-1]=1
        if j<w-1 and b[i][j+1]==0:
            q2.append((i,j+1))
            b[i][j+1]=1
        if i>0 and b[i-1][j]==0:
            q2.append((i-1,j))
            b[i-1][j]=1
        if i<h-1 and b[i+1][j]==0:
            q2.append((i+1,j))
            b[i+1][j]=1
    q=q2
print(ans)

Buggy submission (verdict: Runtime Error):
h,w=map(int, input().split())
a=[input() for i in range(h)]

non=3000
import numpy as np
b=np.full((h,w),non,dtype=int)
q=[]
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            q.append((i,j))
            b[i][j]=0
ans=-1
while len(q)>0:
    ans+=1
    q2=[]
    for i,j in q:
        if j>0 and b[i][j-1]==non:
            q2.append((i,j-1))
            b[i][j-1]=b[i][j]+1
        if j<w-1 and b[i][j+1]==non:
            q2.append((i,j+1))
            b[i][j+1]=b[i][j]+1
        if i>0 and b[i-1][j]==non:
            q2.append((i-1,j))
            b[i-1][j]=b[i][j]+1
        if i<h-1 and b[i+1][j]==non:
            q2.append((i+1,j))
            b[i+1][j]=b[i][j]+1
    q=q2
print(ans)
Problem p03252 (python)

Fixed submission:
S=input()
T=input()
d=[[] for i in range(26)]
for i,c in enumerate(S):
    d[ord(c)-ord('a')].append(i)
d2=[[]for i in range(26)]
for i,c in enumerate(T):
    d2[ord(c)-ord('a')].append(i)
print(['No','Yes'][set((tuple(x) for x in d))==set((tuple(x) for x in d2))])

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
d=[[] for i in range(26)]
for i,c in enumerate(S):
    d[ord(c)-ord('a')].append(i)
d2=[[] for i in range(26)]
for i,c in enumerate(T):
    d2[ord(c)-ord('a')].append(i)
d.sort(key=lambda x:x[0])
d2.sort(key=lambda x:x[0])
f=1
for i in range(26):
    if len(d[i])!=len(d2[i]):
        f=0
    else:
        for j in range(len(d[i])):
            if d[i]!=d2[i]:
                f=0
print(['No','Yes'][f])
Problem p03253 (python)

Fixed submission:
n,m=map(int, input().split())
def is_prime(N):
    is_prime=[True]*(N+1)
    is_prime[0:2]=False,False
    for i in range(int(N**0.5)+1):
        if is_prime[i]==False:
            continue
        for j in range(i*2,N+1,i):
            is_prime[j]=False
    return is_prime
def primes(N):
    prime=is_prime(N)
    return [i for i in range(N+1) if prime[i]]
def prime_factorization(n):
    ps=primes(int(n**0.5))
    r=[]
    for i,p in enumerate(ps):
        num=0
        while(True):
            x,y=divmod(n,p)
            if y!=0:
                break
            n=x
            num+=1
        if num>0:
            r.append((p,num))
    if n>1:
        r.append((n,1))
    return r
mod=10**9+7
def add(a,b):
    return (a+b)%mod
def sub(a,b):
    return (a-b)%mod
def mul(a,b):
    return ((a%mod)*(b%mod))%mod
def pow(x,y):
    if y==0:
        return 1
    elif y==1:
        return x%mod
    elif y%2==0:
        return pow(x,y//2)**2 % mod
    else:
        return pow(x,y//2)**2 * x % mod
def div(a,b):
    return mul(a,pow(b,mod-2))
def fac(n):
    a=1
    for i in range(2,n+1):
        a=mul(a,i)
    return a

f=prime_factorization(m)
ans=1
for p in f:
    ans=mul(ans,fac(p[1]+n-1))
    ans=div(ans,fac(p[1]))
    ans=div(ans,fac(n-1))
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
def is_prime(N):
    is_prime=[True]*(N+1)
    is_prime[0:2]=False,False
    for i in range(int(N**0.5)+1):
        if is_prime[i]==False:
            continue
        for j in range(i*2,N+1,i):
            is_prime[j]=False
    return is_prime
def primes(N):
    prime=is_prime(N)
    return [i for i in range(N+1) if prime[i]]
def prime_factorization(n):
    ps=primes(int(n**0.5))
    r=[]
    for i,p in enumerate(ps):
        num=0
        while(True):
            x,y=divmod(n,p)
            if y!=0:
                break
            n=x
            num+=1
        if num>0:
            r.append((p,num))
    if n>1:
        r.append((n,1))
    return r

f=prime_factorization(m)
from scipy.special import perm, comb
ans=1
mod=10**9+7
for p in f:
    ans*=comb(p[1]+n-1,n-1,exact=True)
    ans%=mod
print(ans)
Problem p03634 (python)

Fixed submission:
N=int(input())
edge=[list(map(int,input().split())) for i in range(N-1)]
inf=10**15
c=[[] for i in range(N)]
for i,j,w in edge:
    c[i-1].append((j-1,w))
    c[j-1].append((i-1,w))
Q,K=map(int, input().split())
d=[inf]*N
d[K-1]=0
v=[0]*N
import sys
sys.setrecursionlimit(10**5+9)
def dfs(p,v,d):
    for n,w in c[p]:
        if v[n]==0:
            d[n]=min(d[n],d[p]+w)
            v[n]=1
            dfs(n,v,d)
dfs(K-1,v,d)
xy=[list(map(int,input().split())) for i in range(Q)]
for x,y in xy:
    print(d[x-1]+d[y-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
edge=[list(map(int,input().split())) for i in range(N-1)]
inf=10**15
c=[[] for i in range(N)]
for i,j,w in edge:
    c[i-1].append((j-1,w))
    c[j-1].append((i-1,w))
Q,K=map(int, input().split())
d=[inf]*N
d[K-1]=0
v=[0]*N
def dfs(p,v,d):
    for n,w in c[p]:
        if v[n]==0:
            d[n]=min(d[n],d[p]+w)
            v[n]=1
            dfs(n,v,d)
dfs(K-1,v,d)
xy=[list(map(int,input().split())) for i in range(Q)]
for x,y in xy:
    print(d[x-1]+d[y-1])
Problem p03822 (python)

Fixed submission:
import sys
def input(): return sys.stdin.readline().strip()
N=int(input())
A=[int(input()) for i in range(N-1)]
c=[[] for i in range(N)]
for i,a in enumerate(A):
    c[a-1].append(i+1)
import sys
sys.setrecursionlimit(10**7)
def f(i):
    if len(c[i])==0:
        return 0
    return max([e+i+1 for i,e in enumerate(sorted([f(j) for j in c[i]],reverse=True))])
print(f(0))

Buggy submission (verdict: Runtime Error):
import sys
def input(): return sys.stdin.readline().strip()
N=int(input())
A=[int(input()) for i in range(N-1)]
c=[[] for i in range(N)]
for i,a in enumerate(A):
    c[a-1].append(i+1)
import sys
sys.setrecursionlimit(10**5+9)
def f(i):
    if len(c[i])==0:
        return 0
    return max([e+i+1 for i,e in enumerate(sorted([f(j) for j in c[i]],reverse=True))])
print(f(0))

Buggy submission (verdict: Runtime Error):
import sys
def input(): return sys.stdin.readline().strip()
N=int(input())
A=[int(input()) for i in range(N-1)]
c=[[] for i in range(N)]
for i,a in enumerate(A):
    c[a-1].append(i+1)
import sys
sys.setrecursionlimit(10**5)
def f(i):
    if len(c[i])==0:
        return 0
    return max([e+i+1 for i,e in enumerate(sorted([f(j) for j in c[i]],reverse=True))])
print(f(0))
Problem p02624 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n+1):
    ans += (i+(n-n%i))*(n//i)//2
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())
ans = 0
for i in range(1, n + 1):
    ans += i * len(sympy.divisors(i))
print(ans)
Problem p02627 (python)

Fixed submission:
a = input()
if a.isupper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for i in range(q)]
for f in bc:
    a = [f[1] if j == f[0] else j for j in a]
    print(sum(a))
Problem p02771 (python)

Fixed submission:
a = list(map(int, input().split()))
if a[0] == a[1] and a[0] != a[2]:
  print("Yes")
elif a[0] != a[1] and a[1] == a[2]:
  print("Yes")
elif a[0] == a[2] and a[0] != a[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(int,, input().split()))
if a[0] == a[1] and a[0] != a[2]:
  print("Yes")
elif a[0] != a[1] and a[1] == a[2]:
  print("Yes")
elif a[0] == a[2] and a[0] != a[1]:
  print("Yes")
else:
  print("No")
Problem p02777 (python)

Fixed submission:
s = input().split()
a, b = map(int, input().split())
t = input()
if s[0] == t:
  print(str(a-1) + " " + str(b))
else:
  print(str(a) + " " + str(b-1))

Buggy submission (verdict: Runtime Error):
s, t = map(input().split())
a, b = map(int, input().split())
t = input()
if s == t:
  print(str(a-1) + " " + str(b))
else:
  print(str(a) + " " + str(b-1))
Problem p02790 (python)

Fixed submission:
a = sorted(input().split())
print(a[0] * int(a[1]))

Buggy submission (verdict: Runtime Error):
a = sorted(input().split())
print(a[0] * a[1]
Problem p02831 (python)

Fixed submission:
a = list(map(int, input().split()))
b = a[0]
while b % a[1] != 0:
  b += a[0]
print(b)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
b = a[0]
while b % a[1] != 0:
  b += a[0]
print(b

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

a = list(map(int, input().split()))
print((a[0] * a[1]) // math.gcd(a[0], a[1]))

Buggy submission (verdict: Runtime Error):
import math

a = list(map(int, input().split()))
print((a[0] * a[1]) // math.gcd(a[0], a[1]))

Buggy submission (verdict: Runtime Error):
import math

a = list(map(int, input().split()))
print((a[0] * a[1]) // math.gcd(a[0], a[1]))

Buggy submission (verdict: Runtime Error):
import math

a = list(map(int, input().split()))
print((a[0] * a[1]) // math.gcd(a[0], a[1]))

Buggy submission (verdict: Runtime Error):
import math

a = list(map(int, input().split()))
print((a[0] * a[1]) // math.gcd(a[0], a[1]))
Problem p02836 (python)

Fixed submission:
n = input()
s = len(n)
s1 = n[:s//2]
s2 = n[-1 * (s//2):]
s2 = s2[::-1]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
s1 = s[:s//2]
s2 = s[-1 * (s//2):]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
s1 = s[:s//2]
s2 = s[-(s//2):]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)
Problem p02989 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(abs(l[n//2-1] - l[n//2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[n//2] - l[n//2  +1])
Problem p03208 (python)

Fixed submission:
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n-k+1):
  ans = min(ans, h[i+k-1] - h[i])
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n-k+1):
  ans = min(ans, h[i:i+k][-1] - a[i:i+k][0])
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n-k+1):
  ans = min(ans, (max(a[i:i+k])-min(a[i:i+k])))
print(ans)
Problem p03242 (python)

Fixed submission:
s = input()
l = []
for i in range(len(s)):
  if s[i] == "1":
    l.append("9")
  elif s[i] == "9":
    l.append("1")
  else:
    l.append(s[i])
for k in l:
  print(k,end="")

Buggy submission (verdict: Runtime Error):
s = list(input())
l = []
for i in range(s):
  if i == "1":
    l.append("9")
  elif i == "9":
    l.append("1")
  else:
    l.append(i)
for k in l:
  print(k,end="")
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
!