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

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from operator import itemgetter
def solve():
    Z = sorted([tuple(map(int,input().split())) for _ in range(int(input()))], key=itemgetter(2,0,1) , reverse=True)
    x0, y0, h0 = Z[0]
    H = h0 + np.abs(np.arange(101, dtype=int).reshape(101,1)-x0) + np.abs(np.arange(101, dtype=int).reshape(1,101)-y0)
    for (i,j), h in np.ndenumerate(H):
        if all(h == max(H[i,j]-abs(x-i)-abs(y-j), 0) for x,y,h in Z):
            return ' '.join(map(str, [i,j,h]))

if __name__ == '__main__':
    print(solve())

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
from operator import itemgetter
def solve():
    Z = sorted([tuple(map(int,input().split())) for _ in range(int(input()))], key=itemgetter(2) , reverse=True)
    x0, y0, h0 = Z[0]
    H = h0 + np.abs(np.arange(101, dtype=int).reshape(1,101)-x0) + np.abs(np.arange(101, dtype=int).reshape(101,1)-y0)
    return [' '.join(map(str, [i,j,h])) for (i,j),h in np.ndenumerate(H) if all(h == max(H[i,j]-abs(x-i)-abs(y-j),0) for x,y,h in Z)][0]

if __name__ == '__main__':
    print(solve())

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
from operator import itemgetter
def solve():
    Z = sorted([tuple(map(int,input().split())) for _ in range(int(input()))], key=itemgetter(2) , reverse=True)
    x0, y0, h0 = Z[0]
    H = h0 + np.abs(np.arange(101, dtype=int).reshape(1,101)-x0) + np.abs(np.arange(101, dtype=int).reshape(101,1)-y0)
    return [' '.join(map(str, [i,j,h])) for (i,j),h in np.ndenumerate(H) if all(h == max(H[i,j]-abs(x-i)-abs(y-j),0) for x,y,h in Z)][0]

if __name__ == '__main__':
    print(solve())
Problem p03244 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from operator import itemgetter
def solve():
    n = int(input())
    V = list(map(int, input().split()))
    l = defaultdict(int)
    u = defaultdict(int)
    for i in range(0,n,2):
        l[V[i]] += 1
        u[V[i+1]] += 1

    l = sorted(list(l.items()),key=itemgetter(1))[::-1]
    u = sorted(list(u.items()),key=itemgetter(1))[::-1]
    if len(l) == len(u) == 1:
        if l[0][0] != u[0][0]:
            res = 0
        else:
            res = min(l[0][1], u[0][1])
    else:
        if l[0][0] != u[0][0]:
            res = sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[1:]))
        elif len(u) == 1 or (len(l) > 1 and l[1][1]+u[0][1] > l[0][1]+u[1][1]):
            res = l[0][1] + sum(map(itemgetter(1), l[2:])) + sum(map(itemgetter(1), u[1:]))
        else:
            res = u[0][1] + sum(map(itemgetter(1), l[1:])) + sum(map(itemgetter(1), u[2:]))

    return str(res)

if __name__ == '__main__':
    print(solve())

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter
from operator import itemgetter
def solve():
    input()
    V = list(map(int, input().split()))
    l = sorted(Counter(V[::2]).items()+[(0,0)], key=itemgetter(1), reverse=True)
    u = sorted(Counter(V[1::2]).items()+[(0,0)], key=itemgetter(1), reverse=True)
    res = sum(map(itemgetter(1), l+u)) - (max(l[0][1]+u[1][1], l[1][1]+u[0][1]) if l[0][0]==u[0][0] else (l[0][1]+u[0][1]))
    return str(res)

if __name__ == '__main__':
    print(solve())
Problem p03274 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

def solve():
    N, K = map(int, input().split())
    C = np.array(list(map(int,input().split())))
    z = (C<0).sum()
    D = set()
    for i in range(N-K+1):
        l = -min(C[i],0)
        r = max(C[i+K-1],0)
        d = 2*l+r if l < r else 2*r+l
        D.add(d)
    return str(min(D))

if __name__ == '__main__':
    print(solve())

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

def solve():
    N, K = map(int, input().split())
    C = np.array(list(map(int,input().split())))
    D = list()
    for i in range(N-K+1):
      c = C[i:i+K]
      l, r = max(c), min(c)
      d = -2*r + l if l > r else  -r + 2*l
      D.append(d)
    return str(min(D)

if __name__ == '__main__':
    print(solve())
Problem p03310 (python)

Fixed submission:
from itertools import accumulate
input()
*s, = accumulate(map(int, input().split()))
l,r,t = 0,2,s[-1]
c = t
for m in s[1:-2]:
    while t+m > s[r]+s[r+1]:
        r += 1
    while m > s[l]+s[l+1]:
        l += 1
    x = sorted([s[l],m-s[l],s[r]-m,t-s[r]])
    c = min(c,x[-1]-x[0])
print(c)

Buggy submission (verdict: Runtime Error):
import numpy as np
from itertools import combinations
N = int(input())
A = np.array(list(map(int, input().split())), dtype= int)
X = A.sum()
A1 = np.cumsum(A)
mincost = -1
for r1, r2, r3 in combinations(range(1,N), 3):
    P = A1[r1]
    Q = Y - A1[r1]
    R = A1[r3]-Y
    S = X-A1[r3]
    cost = max(P,Q,R,S) - min(P,Q,R,S)
    if mincost < 0 or mincost >  cost:
        mincost = cost
print(mincost)
Problem p03330 (python)

Fixed submission:
import numpy as np
N, C = map(int, input().split())
D = np.array(list(map(int, input().split())), dtype=int)
for i in range(C-1):
    D = np.vstack((D, np.array(list(map(int, input().split())), dtype=int)))
Z = np.array(list(map(int, input().split())), dtype=int)
for i in range(N-1):
    Z = np.vstack((Z, np.array(list(map(int, input().split())), dtype=int)))
num = np.zeros((3,C), dtype=int)
for i in range(3):
    X = np.array([[(x+y+2)%3==i for y in range(N)] for x in range(N)])
    for c in range(C):
        Y = ((Z*X)==(c+1))
        num[i,c] = Y.sum()
costs = np.dot(num, D)
mincost = 10**10
for c0 in range(C):
    for c1 in range(C):
        if c1 ==c0:
            continue
        for c2 in range(C):
            if c2 == c0 or c2 == c1:
                continue
            cost = costs[0,c0]+costs[1,c1]+costs[2,c2]
            mincost = min(mincost, cost)
print(mincost)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, C = map(int, input().split())
D = np.array(map(int, input().split()), dtype=int)
for i in range(C-1):
    D = np.vstack((D, np.array(map(int, input().split()), dtype=int)))
Z = np.array(map(int, input().split()), dtype=int)
for i in range(N-1):
    Z = np.vstack((c, np.array(map(int, input().split()), dtype=int)))
num = np.zeros(size=(3,C), dtype=int)
for i in range(3):
    X = np.array([[(x+y+2)%3==i for y in range(N)] for x in range(N)])
    for c in range(C):
        Y = (Z*X)==c+1
        num[i,c] = Y.sum()
costs = np.matmul(num, D)
mincost = 10**10
for c0 in range(C):
    for c1 in range(C):
        if c1 ==c0:
            continue
        for c2 in range(C):
            if c2 == c1:
                continue
            cost = costs[0,c0]+costs[1,c1]+costs[2,c2]
            mincost = min(mincost, cost)
print(mincost)
Problem p02608 (python)

Fixed submission:
import math
n = int(input())
ans = [0 for _ in range(10001)]

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            t = x**2 + y**2 + z**2 + x*y + y*z + z*x 
            if t <= 10000:
                ans[t] += 1
for i in range(1,n+1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = [0 for _ in range(10000)]

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            t = x**2 + y**2 + z**2 + x*y + y*z + z*x 
            if t < 10000:
                ans[t] += 1
for i in range(1,n+1):
    print(ans[i])
Problem p02612 (python)

Fixed submission:
n = int(input())
if n%1000!=0:
    print(1000-(n%1000))
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%1000!=0:
    print(min(1000-(n%1000)))
else:
    print("0")
Problem p02630 (python)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = []
c = []
s = []

ans = sum(a)
s = Counter(a)
for i in range(q):
    bi,ci = map(int, input().split())
    b.append(bi)
    c.append(ci)
for i in range(q):
    ans += s[b[i]] * (c[i]-b[i])
    s[c[i]] += s[b[i]]
    s[b[i]] = 0
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = []
c = []
s = []
for i in range(100000):
    s.append(a.count(i))
ans = sum(a)

for i in range(q):
    bi,ci = map(int, input().split())
    b.append(bi)
    c.append(ci)
for i in range(q):
    ans += s[b[i]] * (c[i]-b[i])
    s[c[i]] += s[b[i]]
    s[b[i]] = 0
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = []
c = []
s = []
for i in range(100000):
    s.append(a.count(i))
ans = sum(a)

for i in range(q):
    bi,ci = map(int, input().split())
    b.append(bi)
    c.append(ci)
for i in range(q):
    ans += s[b[i]] * (c[i]-b[i])
    s[c[i]] += s[b[i]]
    s[b[i]] = 0
    print(ans)
Problem p02641 (python)

Fixed submission:
x,n = map(int, input().split())
p = list(map(int, input().split()))
mini = 1000
for i in range(-200,200):
    if not i in p:
        if mini>abs(x-i):
            ans = i
            mini=abs(x-i)
print(ans)

Buggy submission (verdict: Runtime Error):
x,n = map(int, input().split())
p = list(map(int, input().split()))
mini = 100
for i in range(1,101):
    if not i in p:
        if mini>abs(x-i):
            ans = i
            mini=abs(x-i)
print(ans)

Buggy submission (verdict: Runtime Error):
x,n = map(int, input().split())
p = list(map(int, input().split()))
mini = 100
for i in range(101):
    if not i in p:
        if mini>abs(x-i) and i!=0:
            ans = i
            mini=abs(x-i)
print(ans)

Buggy submission (verdict: Runtime Error):
x,n = map(int, input().split())
p = list(map(int, input().split()))
mini = 100
for i in range(101):
    if not i in p and i!=0:
        if mini>abs(x-i):
            ans = i
            mini=abs(x-i)
print(ans)
Problem p02664 (python)

Fixed submission:
t = list(input())
for i in range(len(t)):
    if t[i]=="?":
        if i==0 and len(t)!=1:
            if t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
            else:
                t[i] = "D"
        elif i!=len(t)-1:
            if t[i-1]=="P":
                t[i] = "D"
            elif t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
            else:
                t[i] = "D"
        else:
            t[i] = "D"
print(*t,sep="")

Buggy submission (verdict: Runtime Error):
t = list(input())
for i in range(len(t)):
    if t[i]=="?":
        if i==0:
            if t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
            else:
                t[i] = "D"
        elif i!=len(t)-1:
            if t[i-1]=="P":
                t[i] = "D"
            if t[i+1]=="D" or t[i+1]=="?":
                t[i] = "P"
                t[i+1] = "D"
        else:
            t[i] = "D"
print(*t,sep="")
Problem p02696 (python)

Fixed submission:
a,b,n=(int(x) for x in input().split())
n = min(b-1,n)
print((a*n)//b-a*(n//b))

Buggy submission (verdict: Runtime Error):
#include <stdio.h>

int main(void){
    long long int a,b,n;
    scanf("%lld %lld %lld",&a,&b,&n);
    printf("%lld\n",(a*(n-1))/b-a*((n-1)/b));
    return 0;
}
Problem p03624 (python)

Fixed submission:
s = list(input())
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s3 = list(set(s2))
s3.sort()
s4 = ['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']
if s3 == s4:
    print('None')
else:
    for i in range(int(len(s3))):
        if s3[i] != s4[i]:
            print(s4[i])
            break
        if i == len(s3)-1:
            print(s4[i+1])

Buggy submission (verdict: Runtime Error):
s = list(input())
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s3 = list(set(s2))
s3.sort()
s4 = ['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']
if s3 == s4:
    print('None')
else:
    for i in range(int(len(s4))):
        if s3[i] != s4[i]:
            print(s4[i])
            break

Buggy submission (verdict: Runtime Error):
s = list(input())
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s2 = list(set(s2))
s2.sort()
s3 = ['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']
if s2 == s3:
    print('None')
else:
    for i in range(int(len(s3))):
        if s2[i] != s3[i]:
            print(s3[i])
            break

Buggy submission (verdict: Runtime Error):
s = input()
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s2 = list(set(s2))
s2.sort()
s3 = ['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']
if s2 == s3:
    print('None')
else:
    for i in range(int(len(s3))):
        if s2[i] != s3[i]:
            print(s3[i])
            break

Buggy submission (verdict: Runtime Error):
s = input()
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s2 = list(set(s2))
s2.sort()
s3 = ['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']
if s2 == s3:
    print('None')
else:
    for i in range(len(s3)):
        if s2[i] != s3[i]:
            print(s3[i])
            break

Buggy submission (verdict: Runtime Error):
s = input()
s2 = []
for i in range(len(s)):
    s2.append(s[i])
s2 = list(set(s2))
s2.sort()
s3 = ['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']
if s2 == s3:
    print('None')
else:
    for i in range(len(s)):
        if s2[i] != s3[i]:
            print(s3[i])
            break
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
lim = 10**18
ans,exc = 1,False
for x in input().split():
  ans *= int(x)
  if ans > lim:
    exc = True
    print("-1")
if not exc:
  print(ans)
Problem p02658 (python)

Fixed submission:
n = int(input())
lim = 10**18
ans,exc = 1,False
a = list(map(int,input().split()))
# print(a)
if 0 in a:
  print(0)
else:
  for x in a:
    ans *= x
    if ans > lim:
      exc = True
      print("-1")
      break
  if not exc:
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
res = 1
exc = False
for i in a:
	res *= i
	if res > 10**18:
      exc = True
      print(-1)
if not exc:
  print(res)
Problem p02706 (python)

Fixed submission:
n,m = map(int,input().split())
a = [int(x) for x in input().split()]
s = sum(a)
if n < s:
  print("-1")
else:
  print(n-s)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input())
a = [int(x) for x in input().split()]
s = sum(a)
if n < s:
  print("-1")
else:
  print(n-s)
Problem p03457 (python)

Fixed submission:
n = int(input())
found = True
ti,xi,yi = 0,0,0
for _ in range(n):
  t,x,y = map(int,input().split())
  rt = abs(x-xi)+abs(y-yi)
  if rt > (t-ti) or (t-ti-rt)&1:
    found = False
  ti,xi,yi = t,x,y
print("Yes" if found else "No")

Buggy submission (verdict: Runtime Error):
n = int(input())
found = True
for _ in range(n):
  t,x,y = map(int,input().split())
  if t==0:
  	if x==0 and y==0:
      found = False
  else:
    if t%(x+y) != 0:
      found = False
if found:
  print("Yes")
else:
  print("No")
Problem p02642 (python)

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

m=1000000
c=[0]*(m+1)

for i in a:c[i]+=1

for i in range(1,m+1):
	if c[i] == 0:continue
	for j in range(i*2,m+1,i):
		c[j]+=1
ans=0
for i in a:
 if c[i]==1:ans+=1
print(ans)

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

m=100000
c=[0]*(m+1)

for i in a:c[i]+=1

for i in range(1,m+1):
	if c[i] == 0:continue
	for j in range(i*2,m+1,i):
		c[j]+=1
ans=0
for i in a:
 if c[i]==1:ans+=1
print(ans)
Problem p02742 (python)

Fixed submission:
H,W=map(int,input().split())
if H==1 or W==1:
	print(1)
else:
	print((H*W+1)//2)

Buggy submission (verdict: Runtime Error):
H,W=map(imt,input().split())
if H==1 or W==1:
	print(1)
else:
	print((H*W+1)//2)
Problem p03449 (python)

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

ans = 0
for i in range(N):
    cur = 0
    for j in range(N):
        if j < i:
            cur += A[j]
        elif j == i:
            cur += A[j] + B[j]
        else:
            cur += B[j]
    ans = max(ans , cur)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int,input().split())
B = map(int,input().split())

ans = 0
for i in range(N):
    cur = 0
    for j in range(N):
        if j < i:
            cur += A[j]
        elif j == i:
            cur += A[j] + B[j]
        else:
            cur += B[j]
    ans = max(ans , cur)
print(ans)
Problem p03622 (python)

Fixed submission:
m=998244353
M=1000001
f=[0]*M
g=[0]*M
h=[0]*M
f[0]=g[0]=f[1]=g[1]=h[1]=1
for i in range(2,M):
	f[i]=f[i-1]*i%m
	h[i]=m-h[m%i]*(m//i)%m
	g[i]=g[i-1]*h[i]%m
A,B=map(int,input().split())
if A<B:
	A,B=B,A
b=1
ans=0
for j in range(1,B+1):
	ans+=b*f[A+B-j]*g[B-j]*g[A]%m
	b=b*2%m
ans=ans*f[A]*f[B]*g[A+B]+A
print(ans%m)

Buggy submission (verdict: Runtime Error):
M=8**7
m,f,g,i=M*476+1,[j:=1],[k:=1]*M,0
while i<M:i+=1;f+=f[-1]*i%m,
g+=pow(f[-1],m-2,m),
while i:g[i-1]=g[i]*i%m;i-=1
A,B=map(int,input().split())
if A<B:A,B=B,A
while j<=B:i+=k*f[A+B-j]*g[B-j];k=k*2%m;j+=1
print((i*f[B]*g[A+B]+A)%m))
Problem p03668 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
N=int(input())
g = [[] for i in range(N)]
for i in range(N-1):
	a,b=map(int,input().split())
	a -= 1
	b -= 1
	g[a].append(b)
	g[b].append(a)

nim = [-1 for i in range(N)]

def dfs(cur,par):
	val = 0
	for dst in g[cur]:
		if dst == par:
			continue
		val ^= dfs(dst,cur) + 1
	nim[cur] = val
	return val

dfs(0 , -1)
#print(nim)
if nim[0] == 0:
	print('Bob')
else:
	print('Alice')

Buggy submission (verdict: Runtime Error):
N=int(input())
g = [[] for i in range(N)]
for i in range(N-1):
	a,b=map(int,input().split())
	a -= 1
	b -= 1
	g[a].append(b)
	g[b].append(a)

nim = [-1 for i in range(N)]

def dfs(cur,par):
	val = 0
	for dst in g[cur]:
		if dst == par:
			continue
		val ^= dfs(dst,cur) + 1
	nim[cur] = val
	return val

dfs(0 , -1)
#print(nim)
if nim[0] == 0:
	print('Bob')
else:
	print('Alice')

Buggy submission (verdict: Runtime Error):
N=int(input())
g = [[] for i in range(N)]
for i in range(N-1):
	a,b=map(int,input().split())
	a -= 1
	b -= 1
	g[a].append(b)
	g[b].append(a)

nim = [-1 for i in range(N)]

def dfs(cur,par):
	val = 0
	for dst in g[cur]:
		if dst == par:
			continue
		val ^= dfs(dst,cur) + 1
	nim[cur] = val
	return val

dfs(0 , -1)
print(nim)
if nim[0] == 0:
	print('Bob')
else:
	print('Alice')
Problem p02582 (python)

Fixed submission:
S = input()
C = 0
l = []
for s in S:
  if s == "R":
    C += 1
  else:
    l.append(C)
    C = 0
l.append(C)
print(max(l))

Buggy submission (verdict: Runtime Error):
S = input()
C = 0
l = []
for s in S:
  if s == "R":
    C += 1
  else:
    l.append(C)
    C = 0
print(max(l))
Problem p02767 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
sl = []

ma, mi = max(l), min(l)
if ma == mi:
  sl.append(0)

for x in range(mi, ma):
  s = 0
  for i in l:
    s += (i - x)**2 
  sl.append(s)

print(min(sl))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
sl = []

ma, mi = max(l), min(l)

for x in range(mi, ma):
  s = 0
  for i in l:
    s += (i - x)**2 
  sl.append(s)

print(min(sl))
Problem p03086 (python)

Fixed submission:
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    if all('ACGT'.count(c) ==  1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
      
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
l = []
v = []
for t in n:
  if t == 'A' or t == 'C' or t == 'G' or t == 'T':
    v.append(t)
  else:
    l.append(v)
    v = []
print(len(max(l)))
Problem p03293 (python)

Fixed submission:
S = input()
T = input()
r = 'No'
t2 = T + T

if set(S) == set(T):
  if t2.count(S) > 0:
    r = 'Yes'
else:
  r = 'No'
  
print(r)

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

t2 = T + T

if set(S) == set(T):
  if t2.count(S) > 0:
    r = 'Yes'
else:
  r = 'No'
  
print(r)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())

if B - A < K*2:
  for i in range(A, B+1):
    print(i)
else:
  for i in range(A, A+K):
    print(i)
  for i in range(B-K+1, B+1):
    print(i)

Buggy submission (verdict: Runtime Error):
2 9 100
Problem p02582 (python)

Fixed submission:
p={'RRR':3,'RRS':2,'SRR':2,'RSR':1,'SSR':1,'RSS':1,'SSS':0,'SRS':1}
print(p[input()])

Buggy submission (verdict: Runtime Error):
p={'RRR':3,'RRS':2,'SRR':2,'RSR':1,'SSR':1,'RSS':1,'SSS':0}
print(p[input()])
Problem p02646 (python)

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if abs(A-B) <= (V-W)*T:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
### A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if abs(A-B) < abs(W-V)*T:
    print("Yes")
else:
    print("No")
Problem p02743 (python)

Fixed submission:
from decimal import *
getcontext().prec = 50
a,b,c = map(int,input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
import sympy as sym
a,b,c = map(int,input().split())

if math.sqrt(sym.Float(a)) + math.sqrt(sym.Float(b)) < math.sqrt(sym.Float(c)):
    print("Yes")
else:
    print("No")
Problem p02748 (python)

Fixed submission:
A,B,M = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = [input().split() for i in range(M)]

mini = min(a) + min(b)

total = []
for i in s:
    total.append(a[int(i[0])-1]+b[int(i[1])-1]- int(i[-1]))
    
mini_2 = min(total)

if mini <= mini_2:
    print(mini)
else:
    print(mini_2)

Buggy submission (verdict: Runtime Error):
A,B,M = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = [input().split() for i in range(M)]

mini = min(a) + min(b)

total = []
for i in s:
    total.append(a[int(i[0])-1]+b[int(i[1])]- int(i[-1]))
    
mini_2 = min(total)

if mini <= mini_2:
    print(mini)
else:
    print(mini_2)
Problem p03456 (python)

Fixed submission:
a,b = input().split()
import math
S = int(a+b)

if math.sqrt(S).is_integer() == True:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = input().split()

S = int(a+b)

if math.sqrt(S).is_integer() == True:
    print("Yes")
else:
    print("No")