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

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
print(int(ls[0]*ls[1]/2))

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
ls=[a,b,c]
ls.sort()
print(ls[0]*ls[1])
Problem p03210 (python)

Fixed submission:
a=int(input())
if a==3 or a==5 or a==7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a=input()
a=int(a)
if a==3:
  print("YES")
if a==5:
  print("YES")
if a==7:
  print("YES")
  else:
    print("NO")
Problem p03211 (python)

Fixed submission:
a=input()
b=753
for i in range(len(a)-2):
  if abs(int(a[i]+a[i+1]+a[i+2])-753)<b:
    b=abs(int(a[i]+a[i+1]+a[i+2])-753)
print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=abs(753-int(a[0]+a[1]+a[2]))
for i in range(int(len(a)-2)):
  if abs(753-int(a[i]+a[i+1]+a[i+2]))>abs(753-int(a[i+1]+a[i+2]+a[i+3])):
    b=abs(753-int(a[i+1]+a[i+2]+a[i+3]))
print(b)
Problem p03219 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
print(int(a+b/2))

Buggy submission (verdict: Runtime Error):
a,b,c,d=input().split()
a=int(a)
b=int(b)
print(a+b/2)
Problem p03220 (python)

Fixed submission:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[i]=abs(c-(b-l[i]*0.006))
for i in range(a):
  if l[i]==min(l):
    print(i+1)

Buggy submission (verdict: Runtime Error):
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[0]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min.l
  print(i)
Problem p03238 (python)

Fixed submission:
a=int(input())
if a==1:
  print("Hello World")
if a==2:
  b=int(input())
  c=int(input())
  print(int(b+c))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
if a==2:
  print(int(b+c))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
if a==2:
  print(b+c)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
else:
  print(b+c)
Problem p03239 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][i])<=b:
    if d>int(c[i][i]):
      d=int(c[i][i])
print(d)
Problem p03243 (python)

Fixed submission:
a=int(input())
b=a%100
c=a//100
if b<=c*11:
  print(c*111)
else:
  print((c+1)*111)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=a%100
c=a//100
if b<=c*11:
  print(c*111)
else:
  print()c+1)*111)
Problem p03264 (python)

Fixed submission:
a=input()
a=int(a)
if a%2==0:
  print(int((a/2)**2))
else:
  print(int(a/2)*(int(int(a/2)+1)))

Buggy submission (verdict: Runtime Error):
a=input()
a=int(a)
if a%2==0:
  print(int((a/2)**2))
else:
  print(int(a/2)*2(int(int(a/2)+1)))

Buggy submission (verdict: Runtime Error):
a=input()
a=int(a)
if a%2==0:
  print(int((a/2)**2))
else:
  print(int(a/2)*2(int(a/2)+1))
Problem p03281 (python)

Fixed submission:
a=int(input())
if a<105:
  print(0)
if 105<=a<135:
  print(1)
if 135<=a<165:
  print(2)
if 165<=a<189:
  print(3)
if 189<=a<195:
  print(4)
if 195<=a:
  print(5)

Buggy submission (verdict: Runtime Error):
a=int(input())
if a<105:
  print(0)
elif 105<=a<135:
  print(1)
elif 135<=a<165:
  print(2)
elif 165<=a<189:
  print(3)
elif:189<=a:
  print(4)

Buggy submission (verdict: Runtime Error):
a=int(input())
if a<105:
  print(0)
elif 105<=a<135:
  print(1)
elif 135<=a<165:
  print(2)
elif 165<=a<189:
  print(3)
elif:189<=a
  print(4)
Problem p03282 (python)

Fixed submission:
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>b:
    print(1)
  else:
    if c>=len(a):
      print(1)
    else:
      print(a[c+1])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>b:
    print(1)
  else:
    print(a[c+1])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>b:
  print(1)
else:
  print(a[c])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>b:
    print(1)
  else:
    print(a[c])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[1])

Buggy submission (verdict: Runtime Error):
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]==1 and a[i+1]==1:
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[1])
Problem p03323 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
  else:
    print(":(")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
      else:
        print(":(")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
    else:
      print(":(")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a<=8:
  if b<=8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a<8:
  if b<8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b=input().split
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")
Problem p03360 (python)

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

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

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

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
d=list(map(int,input().split()))
e=0
f=0
for i in range(b):
  if d[i]>c:
    e=e+1
  if d[i]<c:
    f=f+1
if e>f:
  print(f)
else:
  print(e)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
d=list(map(int,input().split()))
e=0
f=0
for i in range(b):
  if d[i]>c:
    e=e+1
  if d[i]<c:
    f=f+1
if e>f:
  print(f)
else:
  print(e)
Problem p03385 (python)

Fixed submission:
a=input()
if a[0]!=a[1] and a[1]!=a[2] and a[2]!=a[0]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=input()
a=a.sort()
if a=="abc":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=input()
a.sort()
if a=="abc":
  print("Yes")
else:
  print("No")
Problem p03399 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
if a>=b:
  if c>=d:
    print(b+d)
  else:
    print(b+c)
else:
  if c>=d:
    print(a+d)
  else:
    print(a+c)

Buggy submission (verdict: Runtime Error):
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
if a>=b:
  if c>=d:
    print(b+d)
  else:
    print(b+c)
else:
  if c>=d:
    print(a+d)
  else:
    print(a+c)

Buggy submission (verdict: Runtime Error):
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
if a>=b:
  if c>=d:
    print(b+d)
  else:
    print(b+c)
else:
  if c>=d:
    print(a+c)
  else:
    print(a+d)
Problem p03400 (python)

Fixed submission:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
e=0
d=[int(input()) for i in range(a)]
for i in range(a):
  e=e+int((b-1)/d[i])+1
print(e+c)

Buggy submission (verdict: Runtime Error):
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
d=[int(input()) i in range(a)
   e=e+int((b-1)/d[i])+1
print(e)
Problem p03424 (python)

Fixed submission:
a=input()
b=list(map(str,input().split()))
if "Y" in b:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
a=input()
b=list(map(input().split()))
if "Y" in b:
  print("Four")
else:
  print("Three")
Problem p03478 (python)

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
d=0
for i in range(1,a+1):
  if b<=(i//10000+(i//1000-(i//10000)*10))+(i//100-(i//1000)*10)+(i//10-(i//100)*10)+(i//1-(i//10)*10)<=c:
    d=d+i
print(d)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
d=0
for i in range(1,a+1):
  if b<=(i//10000+(i//1000-(i//10000)*10000))+(i//100-(i//1000)*1000))+(i//10-(i//100)*100)+(i//1-(i//10)*10)<=c:
    d=d+i
print(d)
Problem p03501 (python)

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if a*b<=c:
  print(int(a*b))
else:
  print(c)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
if a*b<=c:
  print(int(a*b))
else:
  print(c)
Problem p03556 (python)

Fixed submission:
a=int(input())
i=0
while i**2<=a:
  i=i+1
print((i-1)**2)

Buggy submission (verdict: Runtime Error):
a=int(input())
while i**2<=a:
  i=i+1
print(i**2)
Problem p03605 (python)

Fixed submission:
a=int(input())
b=a%10
if int(a/10)==9:
  print("Yes")
else:
  if b==9:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=a%10
if int(a/10)==9:
  print("Yes")
else:
  if b==9:
    print("Yes")
    else:
      print("No")
Problem p03606 (python)

Fixed submission:
a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  c=c+(int(b[i][1])-int(b[i][0]))
print(c+a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[int(input()) for i range(a)]
c=0
for i range(a):
  c=c+(b[i][1]-b[i][2])
print(c+a)
Problem p03610 (python)

Fixed submission:
a=input()
b=""
if int(len(a))%2==0:
  for i in range(int(len(a)/2)):
    b=b+a[2*i]
  print(b)
else:
  for i in range(int(len(a)/2)+1):
    b=b+a[2*i]
  print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=""
for i in range(a):
  b=b+a[2*i]
print(b)
Problem p03636 (python)

Fixed submission:
a=input()
print(a[0]+str(int(len(a)-2))+a[-1])

Buggy submission (verdict: Runtime Error):
a=input()
print(a[0]+str(len(a-2))+a[-1])
Problem p03657 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
if ((a+b)%3)==0:
  print("Possible")
else:
  if (a%3)==0:
    print("Possible")
  else:
    if (b%3)==0:
      print("Possible")
    else:
      print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
if ((a+b)%3)==0:
  print("Possible")
else:
  if (a%3)==0:
    print("Possible")
  else:
    if (b%3)==0:
      print("Possible")
      else:
        print("Impossible")
Problem p03693 (python)

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if ((100*a+10*b+c)%4)==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if ((100*a+10*b+c)%4)=0:
  print("YES")
else:
  print("NO")
Problem p03694 (python)

Fixed submission:
a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a-1]-b[0])

Buggy submission (verdict: Runtime Error):
a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a]-b[0])
Problem p03698 (python)

Fixed submission:
a=input()
b=[]
c=0
for i in range(len(a)):
  b.append(a[i])
b.sort()
for i in range(len(a)-1):
  if b[i]==b[i+1]:
    c=c+1
if c==0:
  print("yes")
else:
  print("no")

Buggy submission (verdict: Runtime Error):
a=input()
b=[]
c=0
for i in range(len(a)):
  b.append(a[i])
b.sort()
for i in range(len(a-1)):
  if b[i]==b[i+1]:
    c=c+1
if c==0:
  print("yes")
else:
  print("no")
Problem p03699 (python)

Fixed submission:
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
d=0
if c%10!=0:
  print(c)
else:
  for i in range(a):
    if b[i]%10!=0:
      c=c-b[i]
      print(c)
      break
  if sum(b)==c:
    print(0)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
d=0
if c%10!=0:
  print(c)
else:
  for i in range(a):
    if b[i]%!=0:
      d=c-b[i]
      print(d)
      break
  if d==c:
    print(0)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
if c%10!=0:
  print(c)
else:
  for i in range(a):
    if b[i]%!=0:
      d=c-b[i]
      print(d)
      break
  if d==c:
    print(0)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
if c%10!==0:
  print(c)
else:
  while c%10==0:
    for k in range(a):
      c=c-b[k]
  print(c)
Problem p03712 (python)

Fixed submission:
x,y=input().split()
x=int(x)
y=int(y)
a=[input() for i in range(x)]
c=""
for i in range(y+2):
  c=c+"#"
print(c)
for i in range(x):
  print("#"+a[i]+"#")
print(c)

Buggy submission (verdict: Runtime Error):
x,y=input().split()
x=int(x)
y=int(y)
a=[input() for i in range(x)]
c=""
for i in range(y+2):
  c=c+"#"
print(c)
for i in range(y-1):
  print("#"+a[i]+"#")
print(c)

Buggy submission (verdict: Runtime Error):
x,y=input().split()
x=int(x)
y=int(y)
a=[input() for i in range(x)]
c=""
for i in range(y):
  c=c+"#"
print(c)
for i in range(y):
  print("#"+a[i]+"#")
print(c)

Buggy submission (verdict: Runtime Error):
a=[input() for i in range]
c=""
for i in range(len(a[0])+2):
  c=c+"#"
print(c)
for i in range(len(a[0]+2):
  print("#"+a[i]+"#")
print(c)
Problem p03731 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
m=a*b
for i in range(a-1):
  if c[i+1]-c[i]<b:
    m=m-(b-(c[i+1]-c[i]))
print(m)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
m=a*b
for i in range(a):
  if c[i+1]-c[i]<b:
    m=m-(b-(c[i+1]-c[i]))
print(m)
Problem p03738 (python)

Fixed submission:
a=int(input())
b=int(input())
import math
if math.sqrt(a)==math.sqrt(b):
  print("EQUAL")
elif math.sqrt(a)>math.sqrt(b):
  print("GREATER")
elif math.sqrt(a)<math.sqrt(b):
  print("LESS")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
import math
if math.sqrt(a)==math.sqrt(b):
  print("EQUAL")
elif math.sqrt(a)>math.sqrt(b):
  print("GREATER")
  math.sqrt(a)<math.sqrt(b):
  print("LESS")
Problem p03760 (python)

Fixed submission:
a=input()
b=input()
c=len(a)
d=len(b)
x=""
if c<=d:
  for i in range(c):
    x=x+a[i]
    x=x+b[i]
  print(x)
if c>d:
  for i in range(d):
    x=x+a[i]
    x=x+b[i]
  x=x+a[len(a)-1]
  print(x)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=len(a)
d=len(b)
x=""
if c<=d:
  for i in range(c):
    x=x+c[i]
    x=x+d[i]
  print(x)
if c>d:
  for i in range(d):
    x=x+c[i]
    x=x+d[i]
  x=x+c[len(a)-1]
  print(x)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
x=""
for i in range(len(a)//2):
  x=x+a[2i]
for i in range(len(b)//2):
  x=x+b[2i+1]
print(x)
Problem p03796 (python)

Fixed submission:
a=int(input())
b=1
for i in range(1,a+1):
  b=b*i
  if b>1000000007:
    b=b%1000000007
if b<1000000000:
  print(b)
else:
  print(b%1000000007)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=1
for i in range(1,a+1):
  b=b*i
if b<1000000000:
  print(b)
else:
  print(((b/10000000000)*(10000000000))%1000000007)
Problem p03844 (python)

Fixed submission:
a,b,c=input().split()
a=int(a)
c=int(c)
if b=="+":
  print(a+c)
else:
  print(a-c)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
a=int(a)
c=int(c)
if b="+":
  print(a+c)
else:
  print(a-c)
Problem p03845 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=[input().split() for i in range(c)]
for i in range(c):
  print(sum(b)-b[int(d[i][0])-1]+int(d[i][1]))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=[int(input()) for i in range(c)]
for i in range(c):
  print(sum(b)-b[d[i][0]]+d[i][1])
Problem p03852 (python)

Fixed submission:
a=input()
if a=="a":
  print("vowel")
else:
  if a=="i":
    print("vowel")
  else:
    if a=="u":
      print("vowel")
    else:
      if a=="e":
        print("vowel")
      else:
        if a=="o":
          print("vowel")
        else:
          print("consonant")

Buggy submission (verdict: Runtime Error):
A=input()
if A="a":
  print("vowel")
if A="i":
  print("vowel")
if A="u":
  print("vowel")
if A="e":
  print("vowel")
if A="o":
  print("vowel")
else:
  print("consonant")
Problem p03853 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(b)
c=[input() for i in range(a)]
for i in range(a):
  print(b[i])
  print(b[i])
Problem p03945 (python)

Fixed submission:
a=input()
b=0
for i in range(len(a)-1):
  if a[i]!=a[i+1]:
    b=b+1
print(b)

Buggy submission (verdict: Runtime Error):
a=input()
b=0
for i in range(len(a)-1):
  a[i]!=a[i+1]:
    b=b+1
if a[-2]!=a[-1]:
  b=b+1
print(b)
Problem p04011 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
if a>=b:
  print(int((c*b+d*(a-b))))
else:
  print(int(c*a))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(int((c*(b-a)+d*(b)))
Problem p02583 (python)

Fixed submission:
import numpy as np
N = input()
bars = list(map(int, input().split(" ")))

length = len(bars)

def check_triangle(a, b, c):
    if a == b or b == c or c == a:
        return 0
    if ((a + b) > c) and ((b + c) > a) and ((c + a) > b):
        return 1
    else:
        return 0


count = 0
for i, li in enumerate(bars):
    for k in range(i+1, length):
        res = np.sum([check_triangle(bars[i], bars[k], bars[j]) for j in range(k+1, length)])
        count += int(res)
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
bars = list(map(int, input().split(" ")))

length = len(bars)

def check_triangle(a, b, c):
    if a == b or b == c or c == a:
        return 0
    if ((a + b) > c) and ((b + c) > a) and ((c + a) > b):
        return 1
    else:
        return 0


count = 0
for i, li in enumerate(bars):
    for k in range(i+1, length):
        res = np.sum([check_triangle(bars[i], bars[k], bars[j]) for j in range(k+1, length)])
        count += int(res)
print(count)
Problem p02584 (python)

Fixed submission:
x, k, d = map(int, input().split(" "))

x = abs(x)
mov = x // d
ans = 0
if mov >= k:
    ans = x - k * d
else:
    if (k - mov) % 2 == 0:
        ans = x % d
    else:
        ans = abs(x%d - d)
print(ans)

Buggy submission (verdict: Runtime Error):
x, k, d = map(int, input().split(" "))
x = abs(x)
min_val = x
while i <= k:
    val = abs(x + (i * d) - ((k-i) * d))
    if val < min_val:
        min_val = val
    i = i + 1
print(min_val)
Problem p02601 (python)

Fixed submission:
A,B,C = input().split()
K = int(input())
first = "N"
second = "N"
f = 1
s = 1
nokori = K
for i in range(1,K):
    if int(A) < int(B)*f:
        first = "Y"
        break
    else:
        f *= 2
        nokori -= 1
if int(A) < int(B)*f:
        first = "Y"
if first == "Y":
    for o in range(1,nokori+1):
        if int(B)*f < int(C)*s:
            second = "Y"
            break
        else:
            s *= 2
    if int(B)*f < int(C)*s:
            second = "Y"
        
if first == "Y" and second == "Y":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = input().split()
K = int(input())
first = "N"
second = "N"
f = 1
s = 1
for i in range(1,K):
    if int(A) < int(B)*f:
        first = "Y"
        nokori = i
        break
    else:
        f *= 2
        print(f)
if int(A) < int(B)*f:
        first = "Y"
        nokori = i

if first == "Y":
    for o in range(1,nokori):
        if int(B) < int(C)*(s**2):
            second = "Y"
            break
        else:
            s *= 2
    if int(B)*f < int(C)*(s**2):
            second = "Y"
        
if first == "Y" and second == "Y":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = input().split()
K = int(input())
first = "N"
second = "N"
f = 1
s = 1
for i in range(1,K):
    if int(A) < int(B)*f:
        first = "Y"
        nokori = i
        break
    else:
        f *= 2
        print(f)
if int(A) < int(B)*f:
        first = "Y"
        nokori = i

if first == "Y":
    for o in range(1,nokori):
        if int(B) < int(C)*(s**2):
            second = "Y"
            break
        else:
            s *= 2
    if int(B) < int(C)*(s**2):
            second = "Y"
        
if first == "Y" and second == "Y":
    print("Yes")
else:
    print("No")
Problem p02553 (python)

Fixed submission:
a,b,c,d=list(map(int,input().split()))
tmp=[a*c,a*d,b*c,b*d]
print(max(tmp))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
tmp=[a*c,a*d,b*c,b*d]
print(max(tmp))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
if b>=0:
  if d<0:
      ans=a*d
  else:
      ans=b*d
elif b<0:
  if d<0:
      ans=a*c
  else:
      ans=b*d
print(ans)
Problem p02612 (python)

Fixed submission:
N = int(input())
if N % 1000:
    print(1000 - (N % 1000))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
    N = int(input())
    print(1000 - (N % 1000))
Problem p02576 (python)

Fixed submission:
import math
a=input()
a=[int(i) for i in a.split()]

n=math.ceil(a[0]/a[1])
print(n*a[2])

Buggy submission (verdict: Runtime Error):
a=inpiut()
a=[int(i) for i in a.split()]

n=int(a[0]/a[1])
print(n*a[2])
Problem p02657 (python)

Fixed submission:
a=input()
a=a.split()

print(int(a[0])*int(a[1]))

Buggy submission (verdict: Runtime Error):
a=[input() for i in range(2)]

a_num=a[1]
a_num=a_num.split()
a_list=[int(n) for n in a_num]

a_mul=1

for i in a_list:
	a_mul*=i

if a_mul>10**18:
	a_mul=-1

print(a_mul)

Buggy submission (verdict: Runtime Error):
a=[input() for i in range(2)]

a_num=a[1]
a_num=a_num.split()
a_list=[int(n) n in a_num]

a_mul=1

for i in a_list:
	a_mul*=i

if a_mul>10**18:
	a_mul=-1

print(a_mul)
Problem p02675 (python)

Fixed submission:

a = input()

a = list(a)

b = a.pop(-1)

b = int(b)

if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
	print("hon")

if b ==0 or b==6 or b == 8 or b == 1:
	print("pon")

if b == 3:
	print("bon")

Buggy submission (verdict: Runtime Error):
import math

a=input()
a=a.split()
l1=int(a[0])
l2=int(a[1])
h=int(a[2])
m=int(a[3])

de1=math.radians(360*h/12+0.5*m)
de2=math.radians(360*m/60)

#print(de1,de2)

x1=l1*math.cos(de1)
y1=l1*math.sin(de1)

#print(x1,y1)

x2=l2*math.cos(de2)
y2=l2*math.sin(de2)

#print(x2,y2)

l_2=pow(x1-x2,2)+pow(y1-y2,2)
l=pow(l_2,0.5)

print(l)
Problem p02681 (python)

Fixed submission:

a = input()
b = input()

b1=list(b)
b1.pop(-1)
b2=""

for i in b1:
	b2 += i

if a == b2:
	print("Yes")

else:
	print("No")

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

num=[]

x1=[1]*int(b[0])
x2=[0]*int(b[1])
x3=[-1]*int(b[2])

num[len(num):len(num)]=x1
num[len(num):len(num)]=x2
num[len(num):len(num)]=x3

k=int(b[3])
print(sum(num[0:k]))
Problem p02705 (python)

Fixed submission:
from math import pi
R = int(input())
C = 2 * R * pi
print(C)

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

b = [0] * n

for i in a:
    b[i-1] += 1
 
for i in b:
    print(i)