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

Fixed submission:
N = int(input())
S = list(input())

w = 0
e = S[1:].count('E')

leader = S[0]
min_mem=e
cnt_mem=0

for i in range(1, N):
    if leader ==  'W':
        w += 1
    leader = S[i]

    if leader == 'E':
        e -= 1

    cnt_mem = w + e
    if cnt_mem < min_mem:
        min_mem = cnt_mem

print(min_mem)

Buggy submission (verdict: Runtime Error):
	N = int(input())
S = input()

tmp = [int(p.replace('W', '-1')) if p == 'W' else int(p.replace('E', '1')) for p in list(S)]

result = []
cnt = 0
for CTO in range(N):
    for MEM in range(N):
        print(CTO)
        if MEM == CTO:
            continue
        if CTO < MEM:
            if tmp[CTO] == -1:
                if (tmp[MEM] + tmp[CTO]) == 0:
                    cnt += 1
            if tmp[CTO] == 1:
                if (tmp[MEM] + tmp[CTO]) != 0:
                    cnt += 1

        if MEM < CTO:
            if tmp[CTO] == -1:
                if (tmp[MEM] + tmp[CTO]) != 0:
                    cnt += 1
            if tmp[CTO] == 1:
                if  (tmp[MEM] + tmp[CTO]) == 0:
                    cnt += 1
        print(cnt)
    result.append(cnt)
    cnt = 0

result_x = [ result[i] for i in range(N) if result[i] != 0]
print(min(result_x))
Problem p03399 (python)

Fixed submission:
import sys

def main(inp_list):
    #print(inp_list)
    A, B, C, D = map(int, inp_list)
    return min(A, B) + min(C, D)

def init(MODE):
    arr = []
    if MODE == 0:
        while True:
            try:
                arr.append(int(input()))
            except:
                break
        return arr

if __name__ == '__main__':
    """ MODE: 0 縦, 1 縦横, 2 横 """
    MODE = 0
    inp_list = init(MODE)
    print(main(inp_list))

Buggy submission (verdict: Runtime Error):
import sys
std = sys.stdin.read()
std_arr = std.split('\n')
persons = int(std_arr[0])
li = std_arr[1].split()
day = int(li[0])
mod = int(li[1])
patici = {}
p = 0
for i in range(2, len(std_arr)): 
    patici[p] =  int(std_arr[i])
    p += 1

if p != persons:
    print('lack of argument!!!')
    exit()

choko = 0
for i in patici.keys():
    for x in range(0, 100):   
        if (x + 1) * patici[i] + 1 < day :
            print((x + 1) * patici[i] + 1 )
            choko += 1

print(choko + mod)
Problem p03400 (python)

Fixed submission:
import sys

def _calc(Ai, j):
    if j != 0:
        return j * Ai + 1
    if j == 0:
        return 1

def main(inp_list):
    # return inp_list
     N = inp_list[0]
     D = inp_list[1][0]
     X = inp_list[1][1]
     A = inp_list[2:]
     #return type(A[0][0])
     results =[ _calc(per[0], i) for per in A  for i in range(0,100) if _calc(per[0], i) < D + 1]
     return len(list(results)) + X

def init(MODE):
    if MODE == 0:
        while True:
            try:
                result = int(input())
                yield result
            except:
                break

    if MODE == 1:
        while True:
            try:
                li=list(map(int,input().split()))
                yield li
            except:
                break
if __name__ == '__main__':
    """ MODE: 0 縦, 1 縦横, 2 横 """
    MODE = 1
    inp_list = init(MODE)
    print(main(list(inp_list)))

Buggy submission (verdict: Runtime Error):
import sys
std = sys.stdin.read()
std_arr = std.split('\n')
persons = int(std_arr[0])
li = std_arr[1].split()
day = int(li[0])
mod = int(li[1])
patici = {}
p = 0
for i in range(2, len(std_arr)): 
    patici[p] =  int(std_arr[i])
    p += 1

if p != persons:
    print('lack of argument!!!')
    exit()

choko = 0
for i in patici.keys():
    for x in range(0, 100):   
        if (x + 1) * patici[i] + 1 < day :
            print((x + 1) * patici[i] + 1 )
            choko += 1

print(choko + mod)
Problem p03411 (python)

Fixed submission:
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1],reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
    for xr, yr in list(ab):
        if (xr, yr) in resultx:
            continue
        if xr < xb and yr < yb:
            resultx.append((xr,yr))
            resulty.append((xb,yb))
            break

print(len(resultx))

Buggy submission (verdict: Runtime Error):
 N = int(input())
 ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1], reverse=True)
 cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
 resultx = []
 resulty = []
 for xb, yb in list(cd):
     for xr, yr in list(ab):
         if (xr, yr) in resultx:
             continue
         if xr < xb and yr < yb:
             resultx.append((xr,yr))
             resulty.append((xb,yb))
             break

 print(len(resultx))

Buggy submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb or yr < yb:
         print(xr, yr, xb, yb)
         result.append('BINGO!!!')
 print(len(result))

Buggy submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb or yr < yb:
        print(xr, yr, xb, yb)
        result.append('BINGO!!!')
 print(len(result))

Buggy submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb and yr < yb:
         result.append('BINGO!!!')
 print(len(result))
Problem p03308 (python)

Fixed submission:
import numpy as np

a = int(input())
b = input().split()
c = []
for i in range(a):
  c.append(int(b[i]))
ans = 0
for i in range(a):
  for j in range(a):
    d = c[i] - c[j]
    d = np.abs(d)
    if(ans < d):
       ans = d
print(ans)

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

a = input()
b = []
b = input().split()
ans = 0
for i in a-1:
  for j in a-1:
    c = b[i]-b[j]
    if(ans < np.abs(c):
       ans = c
print(c)
Problem p03323 (python)

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

if a>8 or b>8:
	print(":(")
else:
	print("Yay!")

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

if a>8 and b>8
	print(":)")
else:
	print("Yay")
Problem p03324 (python)

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

if d==0:
	if n==100:
		print(101)
	else:
		print(n)
elif d==1:
	if n==100:
		print(10100)
	else:
		print(n*100)
else:
	if n==100:
		print(1010000)
	else:
		print(n*10000)

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

if d=0:
	print(d)
elif d=1:
	print(n*10)
else:
	print(n*10000)
Problem p03369 (python)

Fixed submission:
s=input()
list=list(s)

a=700
#print(list)
for i in range(len(list)):
	if list[i]=="o":
		#print(list[i])
		a=a+100
	else:
		a=a
print(a)

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

a=700
print(list)
for i in range(len(list))
	if list[i]=="○":
		a=a+700
	else:
		a=a
print(a)
Problem p03551 (python)

Fixed submission:
N, M = map(int, input().split())

n = 1
for _ in range(M):
    n *= 2

print(n * ((N - M) * 100 + M * 1900))

Buggy submission (verdict: Runtime Error):
N, Z, W = map(int, input().split())
cards = list(map(int, input().split()))

if N == 1:
    print(cards[0] - W)
else:
    x = abs(cards[-1] - cards[-2])
    y = abs(cards[-1] - W)
    print(max(x, y))

Buggy submission (verdict: Runtime Error):
def main(N, M):
    n = 1
    for _ in range(M):
        n *= 2

    print n * ((N - M) * 100 + M * 1900)

Buggy submission (verdict: Runtime Error):
n = 1
for _ in range(N):
    n *= 2

return n * ((M - N) * 100 + N * 1900)
Problem p03309 (python)

Fixed submission:
import numpy as np
from statistics import median
N = int(input())
A = list(map(lambda x:int(x),input().split(" ")))
npA = np.array(A)
B = npA-(1+np.arange(len(npA)))
opt_b = median(B)
print(int(np.sum(np.abs(B-opt_b))))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(lambda x:int(x),input().split(" ")))
npA = np.array(A)
B = npA-(1+np.arange(len(npA)))
opt_b = statistics.median(B)
print(int(np.sum(np.abs(B-opt_b))))
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B)+min(C,D))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
costs = [0]*N
for i in range(N):
    tmp = A[:]
    A.pop(i)
    A.insert(0,0)
    A.append(0)
    #print(A)
    costs[i] = sum(np.abs(np.diff(A)))
    A = tmp
for i in range(len(costs)):
    print(costs[i])
Problem p03369 (python)

Fixed submission:
a=input()
print(700+a.count("o")*100)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=map(int,input().split())
if a+b>2*c and x>y:
    if a<2*c:
        print(2*c*y+a*(x-y))
    else:
        print(2*c*x)
elif a+b>2*c and x<y:
    if b<2*c:
        print(2*c*x+b*(y-x))
    else:
        print(2*c*y)
else:
    print(a*x+b*y)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=map(int,input().split())
if a+b>2*c and x>y:
    if a<2*c:
        print(2*c*y+a*(x-y))
    else:
        print(2*c*x)
elif a+b>2*c and x<y:
    if b<2*c:
        print(2*c*x+b*(y-x))
    else:
        print(2*c*y)
else:
    print(a*x+b*y)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=map(int,input().split())
if a+b>2*c and x>=y:
    if a<2*c:
        print(2*c*y+a*(x-y))
    else:
        print(2*c*x)
elif a+b>2*c and x<y:
    if a<2*c:
        print(2*c*x+b*(y-x))
    else:
        print(2*c*y)
else:
    print(a*x+b*y)
Problem p03328 (python)

Fixed submission:
a,b = map(int,input().split())
n = (b-a)
sum = 0
for i in range(1,n):
    sum +=i
    if n**2==a+b+(sum-a)*2:    
        print(sum-a)
    else: 
        continue

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
n = (b-a)
sum = 0
for i in range(1,n):
    sum +=i
    if n**2= a+b+(sum-a)*2:    
        print(sum-a)
    else: 
        continue
Problem p03377 (python)

Fixed submission:
A, B, X= map(int,input().split())
if A <= X and A + B >=X:
    print('YES')
else: 
    print('NO')

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

t= [i for i in A if i> 0 and i< X]
s= [i for i in A if i> X and i <N]

print(min(len(t),len(s)))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
print(int(count))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
input(int(count))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
input(int(count))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
input(int(count))
Problem p03309 (python)

Fixed submission:
import numpy as np

n = int(input())
a = [int(_) for _ in input().split()]

sub_num = []

for i in range(1, n+1):
#    print(abs(int(a[i-1]-i)))
    sub_num.append(int(a[i-1]-i))


b = np.median(sub_num)
#print(b)

result = 0
for i in range(n):
    result += abs(sub_num[i] - b)

print(int(result))

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

sub_num = [0]*(2*10**6)

for i in range(1, n+1):
#    print(abs(int(a[i-1]-i)))
    sub_num[abs(int(a[i-1]-i))] += 1

b = -sub_num.index(max(sub_num))
#print(b)

result = 0
for i in range(1, n+1):
    result += abs(a[i-1] - (b + i))

print(result)

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

sub_num = [0]*(2*10**5)

for i in range(1, n+1):
#    print(abs(int(a[i-1]-i)))
    sub_num[abs(int(a[i-1]-i))] += 1

b = -sub_num.index(max(sub_num))
#print(b)

result = 0
for i in range(1, n+1):
    result += abs(a[i-1] - (b + i))

print(result)
Problem p03380 (python)

Fixed submission:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    
    max_num = max(a)
    dif = 10**10
    ansnum = 0
    for num in a:
        if(num != max_num and dif > abs((max_num/2) - num)):
            dif = abs((max_num/2) - num)
            ansnum = num
            
    print("{} {}".format(max_num, ansnum))
        
if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    
    max_num = max(a)
    dif = 99999.
    for num in a:
        if(num != max_num and dif > abs((max_num/2) - num)):
            dif = abs((max_num/2) - num)
            ansnum = num
            
    print("{} {}".format(max_num, ansnum))
        
if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    
    max_num = max(a)
    dif = 99999
    for num in a:
        if(num != max_num and dif > abs((max_num/2) - num)):
            dif = abs((max_num/2) - num)
            ansnum = num
            
    print("{} {}".format(max_num, ansnum))
        
if __name__=="__main__":
    main()
Problem p03308 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split())) 
a_max=max(a)
a_min=min(a)
print(a_max-a_min)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[0]*N
for i in range(N):
    a[i]=int(input())
print(a)   
a_max=max(a)
a_min=min(a)
print(a_max-a_min)

Buggy submission (verdict: Runtime Error):
N=int(input())
a_list=map(int,input().split())
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)

Buggy submission (verdict: Runtime Error):
N=int(input())
a_list=[int(input()) for i in range(N)]
print(a_list)
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)

Buggy submission (verdict: Runtime Error):
N=int(input())
a_list=[]
for i in range(N):
    a_list.append(int(input()))
    
a_max=max(a_list)
a_min=min(a_list)
print(a_max-a_min)
Problem p03337 (python)

Fixed submission:
A,B=map(int,input().split())
print(max(A-B,A+B,A*B))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=str(input())
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        idx=i        
idx=idx+1
sub_X=S[:idx]
sub_Y=S[idx:]
count=0
for str1 in sub_X:
    for str2 in sub_Y:
        if str1==str2:
            count+=1
            
print(int(count/2))
Problem p03338 (python)

Fixed submission:
N=int(input())
S=list(input())
a=[]

for i in range(1,N):
    x=set(S[:i-1:])
    y=set(S[i-1::])
    a.append(len(list(x&y)))
    
print(max(a))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=str(input())
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        idx=i        
idx=idx+1
sub_X=S[:idx]
sub_Y=S[idx:]
import collections
count_list_X=list(collections.Counter(sub_X).keys())
count_list_Y=list(collections.Counter(sub_Y).keys())
max_count=0
count=0
for str1 in count_list_X:
    for str2 in count_list_Y:
        if str1==str2:
            count+=1
if count>max_count:
    max_count=count
print(max_count)

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

for i in range(len(S)-1):
    if S[i]==S[i+1]:
        idx=i        
idx=idx+1
sub_X=S[:idx]
sub_Y=S[idx:]
count=0
for str1 in sub_X:
    for str2 in sub_Y:
        if str1==str2:
            count+=1
            
print(int(count/2))

Buggy submission (verdict: Runtime Error):
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        idx=i        
idx=idx+1
sub_X=S[:idx]
sub_Y=S[idx:]
count=0
for str1 in sub_X:
    for str2 in sub_Y:
        if str1==str2:
            count+=1
            
print(int(count/2))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=str(input())
idx_list=[]
for idx in range(len(S)-1):
    if S[idx]==S[idx+1]:
        idx_list.append(idx)

idx=max(idx_list)+1
sub_X=S[:idx]
sub_Y=S[idx:]

import collections
count_list_X=list(collections.Counter(sub_X).keys())
count_list_Y=list(collections.Counter(sub_Y).keys())


count=0
for str1 in count_list_X:
    for str2 in count_list_Y:
        if str1==str2:
            count+=1
            
print(count)
Problem p03362 (python)

Fixed submission:
N=int(input())
L=[str(i) for i in [11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,
  881,911,941,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451]]

print(" ".join(L[:N]))

Buggy submission (verdict: Runtime Error):
N=int(input())
L=[str(i) for i in [11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,
  881,911,941,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451]]

print('',join(L[:N]))

Buggy submission (verdict: Runtime Error):
N=int(input())
L=[11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,
  881,911,941,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451]

print(''.join(L[:N])）
Problem p03370 (python)

Fixed submission:
import math
N,X=map(int,input().split())
m=[int(input()) for i in range(N)]
res=X-sum(m)
num=N
while res>min(m):
    c=math.floor(res/min(m))
    num+=c
    res=res-c*min(m)
print(num)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
m=[int(input()) for i in range(N)]
res=X-sum(m)
num=N
while res>min(m):
    c=math.floor(res/min(m))
    num+=c
    res=res-c*min(m)
print(num)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
res=X-sum(m)
num=N
while res>min(m):
    c=math.floor(res/min(m))
    num+=c
    res=res-c*min(m)
print(num)
m=[int(input()) for i in range(N)]

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
m=[]
for i in range(N):
    m.append(int(input()))

res=X-sum(m)
num=N
while res>min(m):
    c=math.floor(res/min(m))
    num+=c
    res=res-c*min(m)
print(num)
Problem p03380 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
comb_n=a[0]
a=a[1:]
r_ind=int(comb_n/2)

ans=0
for i in range(len(a)-1):
     if abs(a[i]-r_ind)<=abs(a[i+1]-r_ind):
          ans=a[i]
          break
print(comb_n,ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=a.copy()
b=sorted(b,reverse=True)
comb_n=max(b)
b.pop(0)
c=b
comb_list=[]
ind_list=[]
for i in c:
    comb_list.append(comb(comb_n,i))
    ind_list.append(i)
max_num=max(comb_list)
for i in range(len(comb_list)):
    if comb_list[i]==max_num:
        print(comb_n,ind_list[i])
Problem p03386 (python)

Fixed submission:
A,B,K=map(int,input().split())
if B-A+1-2*K>=0:
    for i in range(A,A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
else:
    for i in range(A,B+1):
        print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
num_rev=num[::-1]
if len(num)-2*K>=0:
    for i in range(K):
        print(num[i])
    for i in range(K):
        print(num_rev[K-i-1])
else:
    for i in num:
        print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
num_rev=num[::-1]
if len(num)-2*K>=0:
    for i in range(K):
        print(num[i])
    for i in range(K):
        print(num_rev[K-i-1])
else:
    for i in num:
        print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
num_rev=num[::-1]
if len(num)-2*K>0:
    for i in range(K):
        print(num[i])
    for i in range(K):
        print(num_rev[K-i-1])
else:
    for i in num:
        print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
num_right=num[:K]
num_left=sorted(num,reverse=True)[:K]
ans=set(num_right+num_left)
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
num_right=num[:K]
num_left=sorted(num,reverse=True)[:K]
ans=list(set(num_right+num_left))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num_right=num[:K]
num_left=sorted(num,reverse=True)[:K]
ans=list(set(num_right+num_left))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
if len(num)%2!=0:
    ans_list=num[:K]+num[len(num)-K+1:]
elif len(num)%2==0:
    ans_list=num[:K]+num[len(num)-K:]
elif len(num)-K>0 or len(num)-K+1>0:
    ans_list=num[:K]
for i in range(len(ans_list)):
    print(ans_list[i])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
if len(num)-K>0:
    if len(num)%2!=0:
        ans_list=num[:K]+num[len(num)-K+1:]
    else:
        ans_list=num[:K]+num[len(num)-K:]
else:
    ans_list=num[:K]
for i in range(len(ans_list)):
    print(ans_list[i])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
num=list(range(A,B+1))
if len(num)+1-K>=0:
    ans_list=num[:K]+num[len(num)-K+1:]
else:
    ans_list=num[:K]
for i in range(len(ans_list)):
    print(ans_list[i])
Problem p03388 (python)

Fixed submission:
Q=int(input())
score=[list(map(int,input().split())) for _ in range(Q)]
import math
for i in range(Q):
    max_num=int(math.sqrt(score[i][0]*score[i][1]))

    if score[i][0]==score[i][1]:
        print(2*max_num-2)
    elif score[i][0]*score[i][1]==max_num**2:
        print(2*max_num-3)
    elif score[i][0]*score[i][1]>max_num*(max_num+1):
        print(2*max_num-1)
    else:
        print(2*max_num-2)

Buggy submission (verdict: Runtime Error):
Q=int(input())
score=[map(int,input().split()) for _ in range(Q)]
import math
for i in range(Q):
    max_num=int(math.sqrt(score[i][0]*score[i][1]))
    if score[i][0]*score[i][1]==max_num:
        print(2*max_num-3)
    elif score[i][0]*score[i][1]>max_num*(max_num+1):
        print(2*max_num-1)
    elif score[i][0]==score[i][1]:
        print(2*max_num-2)
    else:
        print(2*max_num-2)
Problem p03324 (python)

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

if N == 100:
    print(101* (100**D))
else:
    print(N * (100**D))

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

if N == 100:
    print(101* (100*d))
else:
    print(N * (100**d))

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

if n == 100:
    print(101* (100*d))
else:
    print(n * (100**d))
Problem p03323 (python)

Fixed submission:
A , B = map(int, input().split())
if A <= 8 and B <= 8 :
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
A , B = map(int, input())
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(": (")