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

Fixed submission:
import math
H,W = list(map(int,input().split()))
data = [list(input()) for l in range(H)]
check = [[0 for s in range(W)] for k in range(H)]
sum = 0

def search(i,j,H,W,data,check):
    stack = [[i,j]]
    check[i][j] = 1 
    tempSum = 0
    numW = 0
    numB = 0
    while True:
        if len(stack) != 0:
            s = stack[-1]
            hNow,wNow = s[0],s[1]
            WB = data[hNow][wNow]
            if WB == '.':
                numW += 1
            else:
                numB += 1
        else:
            return (numW*numB),check


        stack.pop()

        if hNow < H-1:
            if (data[hNow+1][wNow] != WB) and (check[hNow+1][wNow] == 0):
                stack.append([hNow+1,wNow])
                check[hNow+1][wNow] = 1
        if wNow < W-1:
            if (data[hNow][wNow+1] != WB) and (check[hNow][wNow+1] == 0):
                stack.append([hNow,wNow+1])
                check[hNow][wNow+1] = 1

        if hNow > 0:
            if (data[hNow-1][wNow] != WB) and (check[hNow-1][wNow] == 0):
                stack.append([hNow-1,wNow])
                check[hNow-1][wNow] = 1

        if wNow > 0:
            if (data[hNow][wNow-1] != WB) and (check[hNow][wNow-1] == 0):
                stack.append([hNow,wNow-1])
                check[hNow][wNow-1] = 1
        
for i in range(H):
    for j in range(W):
        if (check[i][j] == 0):
            temp,check = search(i,j,H,W,data,check)
            sum += temp

print(sum)

Buggy submission (verdict: Runtime Error):
H,W = list(map(int,input().split()))
data = [list(input()) for l in range(H)]
visit = [[0 for i in range(W)] for j in range(H)]
sum = 0
def search(i,j,col):
    global H,W,data,visit,sum
    if (i < 0)or(i >= H)or(j < 0)or(j >= W):
        return
    if (i >= 0)and(i <= H-1)and(j >= 0)and(j <= W-1):
        if (visit[i][j]):return
        if (col == '#') and (data[i][j] == '.'):
            sum += 1
            visit[i][j] = 1
        elif (col == '.') and (data[i][j] == '#'):
            visit[i][j] = 1
        elif (col == ''):
            visit[i][j] = 1
        else:return
    
            
    if data[i][j] == '#':
        search(i-1,j,'#')
        search(i,j-1,'#')
        search(i,j+1,'#')
        search(i+1,j,'#')
    if data[i][j] == '.':
        search(i-1,j,'.')
        search(i,j-1,'.')
        search(i,j+1,'.')
        search(i+1,j,'.')
    

for i in range(H):
    for j in range(W):
        if data[i][j] == '#':
            visit = [[0 for i in range(W)] for j in range(H)]
            search(i,j,'')

print(sum)
Problem p03240 (python)

Fixed submission:
N = int(input())
data = [[0 for i in range(3)] for j in range(N)]
for i in range(N):
    data[i][0],data[i][1],data[i][2] = [int(s) for s in input().split()]


for p in data:
    if p[2] != 0:
        base_x = p[0]
        base_y = p[1]
        base_height = p[2]


for Cx in range(0,101):
    for Cy in range(0,101):
        height = abs(base_x-Cx)+abs(base_y-Cy)+base_height
        for p in data:
            if p[2] != max([height-abs(Cx-p[0])-abs(Cy-p[1]),0]):
                break
        else:
            print(str(Cx)+' '+str(Cy)+' '+str(height))
            exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
data = [[0 for i in range(3)] for j in range(N)]
for i in range(N):
    data[i][0],data[i][1],data[i][2] = [int(s) for s in input().split()]

fl = 0
for Cx in range(0,101):
    for Cy in range(0,101):
        s1 = abs(data[0][0]-Cx)+abs(data[0][1]-Cy)+data[0][2]
        for i in range(1,N):
            s2 = abs(data[i][0]-Cx)+abs(data[i][1]-Cy)+data[i][2]
            if s1 != s2:
                break
        else:
            H = s1
            cx = Cx
            cy = Cy
            fl = 1
        if fl:
            break
    if fl:
        break

print(cx,cy,H)
Problem p03262 (python)

Fixed submission:
N_X = list(map(int,input().split()))
data = list(map(int,input().split()))
k = 0

for i in data:
    data[k] = abs(i - N_X[1])
    k += 1

m = min(data)
a = []
for i in range(1,m+1):
    if m % i == 0:
        a.append(i)
        a.append(int(m/i))
    if i**2 > m:
        break

a.sort()
a.reverse()

for i in a:
    if all(c%i == 0 for c in data):
        print(i)
        break

Buggy submission (verdict: Runtime Error):
N_X = list(map(int,input().split()))
data = list(map(int,input().split()))
k = 0

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

def mulgcd(list):
    if len(list)==2:
        return gcd(list[0],list[1])
    return gcd(mulgcd(list[1:]),list[0])


for i in data:
    data[k] = abs(i - N_X[1])
    k += 1


if N_X[0] == 1:
    print(abs(data[0]))
else:
    print(mulgcd(data))
Problem p04043 (python)

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

S = sum(L)
S2 = S - L[0]
S1 = S2 - L[1]

if S != 17:
    print('NO')
else:
    if S2==10 and S1==5:
        print('YES')
    elif S2==12 and (S1==5 or S1==7):
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
L = list(map(int(),input().split()))
if sum(L)==17:
  print('YES')
else:
  pritn('NO')

Buggy submission (verdict: Runtime Error):
lst = input('3 nums with 2 space(1<=nums<=10):')
i = 0
for n in lst:
  if n>10 or n<1:
    print('NO')
    break
    
  if n==5:
    i += 1
  elif n==7:
    i -= 1
if i == 1:
  print('YES')
else:
  print('NO')
Problem p03085 (python)

Fixed submission:
a = input()
if a is 'A' :
	print('T')
elif a is 'T' :
	print('A')
elif a is 'C' :
	print('G')
else:
	print('C')

Buggy submission (verdict: Runtime Error):
a = input()
if a = A :
	print('T')
elif a = T :
	print('A')
elif a = C :
	print('G')
else:
	print('C')
Problem p02946 (python)

Fixed submission:
k, x = map(int, input().split())
tmp = [str(y) for y in range(x-k+1, x+k)]
print(' '.join(tmp))

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())

tmp = [y for y in range(x-k+1, x+k)]
y = ' '.join(tmp)
print(y)
Problem p02945 (python)

Fixed submission:
A, B = [int(i) for i in input().split(' ')]
print(max((A + B), (A - B), (A * B)))

Buggy submission (verdict: Runtime Error):
A, B = [int(i) for i input().split(' ')]
print(max((A + B), (A - B), (A * B)))
Problem p02945 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
max(a + b, a - b, a * b)

Buggy submission (verdict: Runtime Error):
a, b = input(), input()
max(a + b, a - b, a * b)
Problem p02946 (python)

Fixed submission:
k, x = [int(x) for x in input().split()]
print(" ".join(str(i) for i in range(x - k + 1, x + k)))

Buggy submission (verdict: Runtime Error):
k, x = [int(x) for x in input().split()]
print(" ".join(range(x - k + 1, x + k - 1)))
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
M = []
kakeru = A*B
tasu = A+B
hiku = A-B
M.append(kakeru)
M.append(tasu)
M.append(hiku)
M.sort(reverse = True)
print(M[0])

Buggy submission (verdict: Runtime Error):
def for_factorial(n):
    val = 1
    for i in range(2, n + 1):
        val *= i
    return int(val/2)
N = int(input())
l = []
_l = [] #並び替えた文字列の格納
_c = 0 #カウントの総合
#1)リストの作成
for i in range(N):
    l.append(input())
#2)文字列の並び替えを"_l"に格納
for s in l:
    one_l = [c for c in s]
    one_l.sort()
    _one_l = "".join(one_l)
    _l.append(_one_l)
#3)アナグラム判定
for s in _l[:]:
    c = _l.count(s)
    if c > 1:
        #cの組み合わせを考える c C 2 
        _c += for_factorial(c)
        _l.remove(s)
print(_c)
Problem p02999 (python)

Fixed submission:
x,a=map(int,input().split())
if x<a:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
a=input();
b=input();
if a<b:
    print(0);
else:
    print(10);
Problem p02945 (python)

Fixed submission:
str = input()

A = (int(str.split()[0]))
B = (int(str.split()[1]))

X = A + B
Y = A - B
Z = A * B
E = 0
if (X < Y) :
	if (Y < Z) :
		E = Z
	else :
		E = Y
else :
	if (X < Z) :
		E = Z
	else :
		E = X
print("{}".format(E))

Buggy submission (verdict: Runtime Error):
str = input()
N = int(str.split()[0])
d = []
for i in range(N) :
	s = str = input()
	dict = {}
	for j in range(26):
		dict[j] = 0
	for j in range(10) :
		k = ord(s[j]) - ord("a")
		dict[k] = dict[k] + 1
	d.append(dict)
	
E = 0
while(len(d) != 0) :
	deli = []
	for i in range(1, len(d)) :
		f = 0
		for j in range(26):
			if (d[0][j] != d[i][j]) :
				f = 1
				break
		if (f != 1) :
			deli.append(i)
	a = 0
	while(len(deli) != 0) :
		d.pop(deli[0] - a)
		deli.pop(0)
		a = a + 1
	if (len(d) != 0) :
		if (a != 0) :
			E = E + a * (a - 1) / 2
		d.pop(0)
print(E)

Buggy submission (verdict: Runtime Error):
pdic = {1: 0, 2: 1, 3: 3}

def p(a):
	if (a in pdic) :
		return dpic[a]
	else :
		pdic[a] = p(a - a) * a
	return p(a - 1) * a

str = input()
N = int(str.split()[0])
d = []
for i in range(N) :
	s = str = input()
	dict = {}
	for j in range(26):
		dict[j] = 0
	for j in range(10) :
		k = ord(s[j]) - ord("a")
		dict[k] = dict[k] + 1
	d.append(dict)
	
E = 0
while(len(d) != 0) :
	deli = []
	for i in range(1, len(d)) :
		f = 0
		for j in range(26):
			if (d[0][j] != d[i][j]) :
				f = 1
				break
		if (f != 1) :
			deli.append(i)
	a = 0
	while(len(deli) != 0) :
		d.pop(deli[0] - a)
		deli.pop(0)
		a = a + 1
	if (len(d) != 0) :
		if (a != 0) :
			E = E + p(a + 1)
		d.pop(0)
print(E)
Problem p03000 (python)

Fixed submission:
str = input()
N = int(str.split()[0])
X = int(str.split()[1])

str = input()
L = []
for i in range(N) :
	L.append(int(str.split()[i]))

D = 0
i = 0
while(D <= X) :
	if (i == len(L)) :
		if (D <= X):
			i = N + 1
		break
	D = D + L[i]
	i = i + 1


print(i)

Buggy submission (verdict: Runtime Error):
str = input()
N = int(str.split()[0])
X = int(str.split()[1])

str = input()
L = []
for i in range(N) :
	L.append(int(str.split()[i]))

D = 0
i = 0
while(D <= X) :
	D = D + L[i]
	i = i + 1


print(i)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
i = input().split()
if i[0] % i[1] == 0:
  print(Even)
else:
  print(Odd)
Problem p02999 (python)

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

if x<a:
    print("0")

else:
    print("10")

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split())

#case1
a=x*H
b=(W-x)*H

if a>=b:
    case1=b
else:
    case1=a

#case2
c=W*y
d=W*(H-y)

if c>=d:
    case2=d
else:
    case2=c

if case1==case2:
    z=1

else:
    z=0

print("{0:.6f}".format(max(case1,case2)),z)

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(str,input().split())

#case1
a=x*H
b=(W-x)*H

if a>=b:
    case1=b
else:
    case1=a

#case2
c=W*y
d=W*(H-y)

if c>=d:
    case2=d
else:
    case2=c

if case1==case2:
    z=1

else:
    z=0

print("{0:.9f}".format(max(case1,case2)),z)
Problem p03385 (python)

Fixed submission:
s=input()

if "a" in s and "b" in s and "c" in s:
    print("Yes")

else:
    print("No")

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

if b-a+1<=2*k:
    for i in range(a,b+1):
        print(i)

else:
    aa=[a+i for i in range(k)]
    bb=[b-j for j in range(k)]
    cc=sorted(aa+bb)
    for s in cc:
        print(s)
Problem p03679 (python)

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

if x+1<=(b-a):
    print("dangerous")

elif a>=b:
    print("delicious")

elif (b-a)<=x:
    print("safe")

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

a=[]
for i in range(n):
    a.append(int(input()))

cnt=0
ans=-1
x=1

for i in range(n):
    x=a[x-1]
    cnt+=1
    if x==2:
        ans=cnt
        break

print(ans)
Problem p03826 (python)

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

x=int(a)*int(b)
y=int(c)*int(d)

if x>y:
    print(x)

elif x<y:
    print(y)

else:
    print(x)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
d=input()

x=int(a)*int(b)
y=int(c)*int(d)

if x>y:
    print(x)

elif x<y:
    print(y)

else:
    print(x)
Problem p03844 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a, op, b = input().split()

if op == '+':
    print(int(a) + int(b))
else:
    print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
A=input('数字を入力＞')
op=input('＞')
B=input('数字を入力＞')
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
A=input('数字を入力＞')
op=raw_input('＞')
B=input('数字を入力＞')
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
A=input('数字を入力＞')
op=raw_input('＋又はーを入力＞')
B=input('数字を入力>')
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
# coding: cp932
A=input('数字を入力＞')
op=raw_input('＋又はーを入力＞')
B=input('数字を入力>')
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))
Problem p03943 (python)

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

answer=sorted(nums,reverse=True)

if sum(answer)%2==0 and answer[0]==answer[1]+answer[2]:
	print("Yes")

else:
	print("No")

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


x_min=0
y_min=0

for i in range(n):
    x,y,a=map(int,input().split())

    if a==1:
        x_min=max(x_min,x)

    elif a==2:
        w=min(x,w)

    elif a==3:
        y_min=max(y_min,y)

    elif a==4:
        h=min(y,h)

white=(w-x_min)*(h-y_min)

if white>0:
  print(white)
  
else:
  print("0")

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

min_x=0
min_y=0

for i in range(n):
    x,y,a=map(int,input().split())

    if a==1:
        min_x=max(min_x,x)

    elif a==2:
        w=min(w,x)

    elif a==3:
        min_y=max(min_y,y)

    elif a==4:
        h=min(h,y)

white=int((w-min_x)*(h-min_y))

if white>0:
    print(white)

else:
    print("0")

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

min_x=0
min_y=0

for i in range(n):
    x,y,a=map(int,input().split())

    if a==1:
       min_x=max(min_x,x)

    elif a==2:
        w=min(w,x)

    elif a==3:
        min_y=max(min_y,y)

    else:
        h=min(h,y)

white=(w-min_x)*(h-min_y)
print(white)
Problem p03323 (python)

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

if a+b <= 16 and a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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

if a+b <= 16:
    print("Yay!")
else:
    print(":(")
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
import sys
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
a2 = a.copy()
res = []
for i in range(0,n):
    a2.pop(i)
    res.append(reduce(fractions.gcd,a2))
    a2 = a.copy()
print(max(res))

Buggy submission (verdict: Runtime Error):
import fractions
import copy
from functools import reduce
import sys
def gcd_list(numbers):
    return reduce(fractions.gcd,numbers)
  
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
a2 = copy.deepcopy(a)
res = []
for i in range(0,n):
    a2.pop(i)
    res.append(gcd_list(a2))
    a2 = copy.deepcopy(a)
print(max(res))

Buggy submission (verdict: Runtime Error):
import fractions
import copy
from functools import reduce
 
def gcd_list(numbers):
    return reduce(fractions.gcd,numbers)
  
n = int(input())
a = list(map(int,input().split()))
a2 = copy.deepcopy(a)
res = []
for i in range(0,n):
    a2.pop(i)
    res.append(gcd_list(a2))
    a2 = copy.deepcopy(a)
print(max(res))

Buggy submission (verdict: Runtime Error):
import fractions
import copy

def gcd_list(numbers):
    ans = numbers[0]
    for i in range(1,n-1):
        ans = fractions.gcd(ans,numbers[i])
    return ans
  
n = int(input())
a = list(map(int,input().split()))
a2 = copy.deepcopy(a)
res = []
for i in range(0,n):
    a2.pop(i)
    res.append(gcd_list(a2))
    a2 = copy.deepcopy(a)
print(max(res))

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    if(b==0): 
        return a 
    else: 
        return gcd(b,a%b)

n = int(input())
a = list(map(int,input().split()))
res = []
for i in range(0,n):
    for j in range(0,n):
        if i != j:
            res.append(gcd(a[i],a[j]))
print(max(res))

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    if(b==0): 
        return a 
    else: 
        return gcd(b,a%b)


n = int(input())
a = map(int,input().split())
a = list(map(int, a))
a1 = a
res = 0
count = 0
count1 = 0
for i in a:
    for j in a1:
        if count != count1 and gcd(i,j)>res:
            res = gcd(i,j)
        count1 = count1 + 1
    count = count + 1
    count1 = 0
print(res)
Problem p03029 (python)

Fixed submission:
import math
a,p=map(int,input().split())
p=p+a*3
print(int(math.floor(p/2)))

Buggy submission (verdict: Runtime Error):
import math
a,p=map(int.input().split())
p=p+a*3
print(math.floor(p/3))
Problem p03796 (python)

Fixed submission:
n=int(input())
power=1
for i in range(1,n+1):
  power=(power*i)%(10**9+7)
print(int(power))

Buggy submission (verdict: Runtime Error):
n=input()
power=1
for i in range(1,n+1):
  power=power*i
print(power%(10**9+7))
Problem p03845 (python)

Fixed submission:
n=int(input())
t=input().split()
#n==len(t)
m=int(input())
px=[]
for i in range(m):
  px.append(input().split())
res=0
for j in range(1,m+1):
  for k in range(1,n+1):	
    if k==int(px[j-1][0]):
      res+=int(px[j-1][1])
      #print(12345)
    else:
      res+=int(t[k-1])
      #print('drink')
  print(res)
  res=0

Buggy submission (verdict: Runtime Error):
n=int(input())
t=map(int,input().split())
#n==len(t)
m=int(input())
px=[]
for i in range(n):
  px.append(map(input().split()))
res=0
for j in range(m):
  for k in range(n):	
    if j==px[j][0]:
      res+=px[j][1]
    else:
      res+=t[k]
  print(res)
  res=0
Problem p04043 (python)

Fixed submission:
str=input().split()
str.sort()
if str==['5','5','7']:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[]
res=''
for i in range(n):
  s.append(input())
s.sort()
for k in range(n):
  res+=s[k]
print(res)
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
s=[]
t=''
for i in range(n):
  s.append(input())
s.sort()
for k in s:
  t+=k
print(t)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[0]*n
res=''
for i in range(n):
  s.append(input())
s.sort()
for k in range(n):
  res+=s[k]
print(res)
Problem p02945 (python)

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

a1 = A+B
a2 = A-B
a3 = A*B

am = max([a1,a2,a3])

print(am)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N = int(input())
s = [list(input()) for i in range(N)]
 
a = 0
for i,j in combinations(s,2):
  if set(i) == set(j):
    a+=1
print(a)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N = int(input())
s = [list(input()) for i in range(N)]
 
a = 0
for i,j in combinations(s,2):
  if set(i) == set(j):
    a+=1
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [list(input()) for i in range(N)]
 
from itertools import combinations
 
a = 0
for i,j in combinations(s,2):
  if set(i) == set(j):
    a+=1
print(a)
Problem p02957 (python)

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

K = (A+B)/2
K_ = (A+B)%2
if K_>0:
  print("IMPOSSIBLE")
else:
  print(int(K))

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

K = (A+B)/2
K_ = (A+B)%2
if K_>0:
  print("IMPOSSIBLE")
else:
  print(int(K)
Problem p02981 (python)

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

train = N*A
taxi = B

if train>=taxi:
  print(taxi)
else:
  print(train)

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

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(len(A)-1):
  X.append((A[i]-X[i]/2)*2)

print(" ".join(repr(int(e)) for e in X))

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

X1by2 = 0
for i in range(N):
  if i%2 ==0:
    X1by2 += A[i]
  else:
    X1by2 -= A[i]

X = []

X.append(X1by2)
for i in range(1,len(A)):
  X.append((A[i]-X1by2/2)*2)

print(" ".join(repr(int(e)) for e in X))

Buggy submission (verdict: Runtime Error):
L, R = map(int,input().split())
L_mod = L%2019
if L_mod ==0:
  print(0)
else:
  R_mod = R%2019
  if R_mod ==0:
    print(0)
  else:
    if L_mod<R_mod:
      list =[]
      for i in range(L_mod,R_mod,1):
        mod_i = i%2019
        for j in range(i+1,R_mod+1,1):
          mod_j = j%2019
          mod = (mod_i *mod_j)%2019
          list.append(mod)

      print(min(list))
      
    else:
      print(0)
Problem p02983 (python)

Fixed submission:
L, R = map(int,input().split())
L_mod = L%2019
if L_mod ==0:
  print(0)
else:
  R_mod = R%2019
  if R_mod ==0:
    print(0)
  else:
    if L_mod<R_mod:
      Ls = L//2019
      Rs = R//2019
      if Rs-Ls ==0:
        list =[]
        for i in range(L_mod,R_mod,1):
          mod_i = i%2019
          for j in range(i+1,R_mod+1,1):
            mod_j = j%2019
            mod = (mod_i *mod_j)%2019
            list.append(mod)

        print(min(list))
      else:
        print(0)
    else:
      print(0)

Buggy submission (verdict: Runtime Error):
L, R = map(int,input().split())
L_mod = L%2019
R_mod = R%2019
list =[]
for i in range(L_mod,R_mod,1):
  mod_i = i%2019
  for j in range(i+1,R_mod+1,1):
    mod_j = j%2019
    mod = (mod_i *mod_j)%2019
    list.append(mod)
    
print(min(list))
Problem p02988 (python)

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

a = 0
for i in range(1,n-1,1):
  if p[i-1]<p[i]:
    if p[i]<=p[i+1]:
      a +=1
  if p[i+1]<p[i]:
    if p[i]<=p[i-1]:
      a +=1

print(a)

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

a = 0
for i in range(2,n,1):
  if p[i-1]<p[i]:
    if p[i]<=p[i+1]:
      a +=1
  if p[i+1]<p[i]:
    if p[i]<=p[i-1]:
      a +=1

print(a)
Problem p02945 (python)

Fixed submission:
A, B = list(map(int, input().split()))
plus = A + B
minus = A - B
times = A * B
results = [plus, minus, times]
max_val = -float('inf')
for r in results:
  if r > max_val:
    max_val = r
print(max_val)

Buggy submission (verdict: Runtime Error):
from collections import Counter as counter

N = int(input())
char_counts = [counter(input()) for i in range(N)]
match_count = 0
for i, c in enumerate(char_counts):
  for j in range(i+1, N, 1):
    if char_counts[j] == c:
      match_count += 1
print(match_count)
Problem p02999 (python)

Fixed submission:
a, x = map(int, input().split())
if a<x:
    print(0)        
elif a>=x:
    print(10)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = [int(i) for i in input().split()]
left = 0
right = len(s)
count = 0
while not(right == len(s) and left == len(s)):
    if sum(s[left:right])>k:
        count += 1
    if sum(s[left:right])>k:
        right += -1
    else:
        right = len(s)
        left += 1
print(count)
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())
print((a*3+p)//2)

Buggy submission (verdict: Runtime Error):
a, p = map(int, input().split())
 (a*3+p)//2

Buggy submission (verdict: Runtime Error):
n= int(input())
s = [[input().split()]for i in range(n)]
s1 = sorted(s)
for i in range(n):
    print(s.index(s1[i]))
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
s = []
for i in range(N):
    s.append(input())
s = sorted(s)
ans = "".join(s)
print(ans)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
s = []
ans = []
dj = list(arange(N))
for i in range(N):
    s.append(input())
s = sorted(s)
ans = "".join(s)
Problem p02945 (python)

Fixed submission:
def main(text):
    a = list(map(int, text.split()))
    print(max([a[0]+a[1], a[0]-a[1], a[0]*a[1]]))


main(input())

Buggy submission (verdict: Runtime Error):
a = input().split()
print(max[a[0]+a[1], a[0]-a[1], a[0]*a[1]])