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

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

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A>8 or B>8:
    print( ':(')    
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A>8 or B>8:
    print( ':(')    
else:
    print('Yay!')
Problem p03423 (python)

Fixed submission:
N = int(input())
print(N//3)

Buggy submission (verdict: Runtime Error):
H,W,D = map(int,input().split())
A = []

for i in range(H):
    AH = map(int,input().split())
    A.append(list(AH))
Q = int(input())

for l in range(Q):
    s=0
    L,R = map(int,input().split())
    
    while L != R:
        for m in A:
            if L in m:
                i=A.index(m)
                j=m.index(L)
            if L+D in m:
                x=A.index(m)
                y=m.index(L+D)
                
        L +=D
        s += abs(x-i)+abs(y-j)
            
    print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S2):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)
Problem p03425 (python)

Fixed submission:
N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)

Buggy submission (verdict: Runtime Error):
N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S1):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)
Problem p03324 (python)

Fixed submission:
# -*- coding: utf-8 -*-
multi_0 = [a for a in range(1,100)]
multi_100 = [a for a in range(100,10000) if a % 100 == 0]
multi_10000 = [a for a in range(10000, 1000000) if a % 10000 == 0]

multi_0 += [101]
multi_100 += [10100]
multi_10000 += [1010000]

D, N = map(int, input().split())
if D == 0:
    print(multi_0[N-1])
elif D == 1:
    print(multi_100[N-1])
elif D == 2:
    print(multi_10000[N-1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
multi_0 = [a for a in range(1,100)]
multi_100 = [a for a in range(100,10001) if a % 100 == 0]
multi_10000 = [a for a in range(10000, 1000001) if a % 10000 == 0]

D, N = map(int, input().split())
if D == 0:
    print(multi_0[N-1])
elif D == 1:
    print(multi_100[N-1])
elif D == 2:
    print(multi_10000[N-1])
Problem p02993 (python)

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

if a[0]-a[1]==0 or a[1]-a[2]==0 or a[2]-a[3]==0:
    print("Bad")
else:
    print("Good")

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

if a[0]-a[1]==0 or a[1]-a[2]==0 or a[2]-a[3]==0:
    print("Bad")
else:
    print("Good")

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

if a[0]-a[1]=0 or a[1]-a[2]=0 or a[2]-a[3]=0:
    print("Bad")
else:
    print("Good")

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

if a[0]-a[1]=0 or a[1]-a[2]=0 or a[2]-a[3]=0:
    print("Bad")
else:
    print("Good")

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

if a[0]-a[1]=0 or a[1]-a[2]=0 or a[2]-a[3]=0 or a[3]-a[4]=0:
    print("Bad")
else:
    print("Good")
Problem p03448 (python)

Fixed submission:
a, b, c, x = [int(input()) for _ in range(4)]
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = [int(input()) for _ in range(4)]
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
prit(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, x = [int(input()) for _ in range(4)]
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*a+100*b+50*c == x:
        ans += 1
prit(ans)
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):
a, b = map(int, input().split())

if a*b % 2 == 0
print('Odd')
else:
  print('Even')
Problem p03471 (python)

Fixed submission:
n, y = list(map(int, input().split()))
ans = 0

for i in range(n+1):
    a1 = 10000 * i
    for j in range(n+1-i):
        a2 = 5000 * j
        k = n- (i+j)
        a3 = k*1000
        if a1 + a2 + a3  == y and i + j + k == n:
            print(i, j , k)
            ans += 1
            exit(0)
    if ans == 1:
        break
if ans == 0:
    print(-1, -1, -1)

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

for i in y:
  for j in y:
    for k in y:
      if i / 10000  + j / 5000 + k / 1000 == 0 and i + j + k == n:
        print(i, j , k)
      else:
        print(-1, -1, -1)
Problem p03493 (python)

Fixed submission:
s = input()
s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])

print(s1 + s2+s3)

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

while True:
  if [i for i in a if i%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().spliit()]
ans = 0

while True:
  if [i for i in a if i%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().spliit()]
ans = 0

while True:
  if a%2 == 1:
    break
  a = a//2 
  ans += 1
print(ans)

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

while True:
  if a%2 == 1:
    break
  a = a//2 
  ans += 1
print(ans)

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

while True:
  if a%2 == 1:
    break
  ans += 1
print(ans)

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

while True:
  if a%2 == 1:
    print(0)
  print(ans)
  ans += 1
Problem p03494 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
ans = 0

while True:
  if [i for i in a if i%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().spliit()]
ans = 0

while True:
  if [i for i in a if a%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)

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

while True:
  if a%2 == 1:
    print(0)
  print(ans)
  ans += 1
Problem p02993 (python)

Fixed submission:
input_number = int(input())
 
a = input_number//1000
b = (input_number-1000*a)//100
c = (input_number-1000*a-100*b)//10
d = input_number-1000*a-100*b-c*10
if a==b:
	print('Bad')
elif b==c:
	print('Bad')
elif c==d:
	print('Bad')
else:
    print('Good')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = int(input())
 
aji = [(i+1)+L-1 for i in range(N)]
min = min(list(map(abs, aji)))
print(sum(aji)-min)

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

a = input_number//1000
b = (input_number-1000*a)//100
c = (input_number-1000*a-100*b)//10
d = input_number-1000*a-100*b-c*10
if a==b;
	print('Bad')
elif b==c;
	print('Bad')
elif c==d;
	print('Bad')
else:
    print('Good')
Problem p02994 (python)

Fixed submission:
N,L = input().split()

aji = [(i+1)+int(L)-1 for i in range(int(N))]
abs = list(map(abs, aji))
index = abs.index(min(abs))

print(sum(aji)-aji[index])

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

aji = [(i+1)+L-1 for i in range(N)]
abs = list(map(abs, aji))
index = abs.index(min(abs))

print(sum(aji)-aji[index])

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

aji = [(i+1)+L-1 for i in range(N)]
min = min(list(map(abs, aji)))
print(sum(aji)-min)

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

aji = [(i+1)+L-1 for i in range(N)]
min = min(list(map(aji, abs)))
print(sum(aji)-min)
Problem p03035 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# スペース区切りの整数の入力
a, b = map(int, raw_input().split())
# 文字列の入力

if a < 6:
  result = b/2
  print 0
  sys.exit()

if 6 <= a and a <= 12 :
  result = b/2
  print result
  sys.exit()
result = b
print result

Buggy submission (verdict: Runtime Error):
import sys
a, b, c = map(int, raw_input().split())
i=0
while 1:
  c = a*c - b
  print c
  i = i + 1
  if i > 9 :
      sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
a, b, c = map(int, raw_input().split())
i=0
while 1:
  c = a*c - b
  print c
  i = i + 1
  if i > 9 :
      sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
a, b, c = map(int, raw_input().split())
i=0
while 1:
  c = a*c - b
  print c
  i = i + 1
  if i > 10 :
      sys.exit()
Problem p02993 (python)

Fixed submission:
s=list(input())

ans = 'Good'
i = 0

while i+1 < len(s):
  if s[i] == s[i+1]:
    ans = 'Bad'
    break
  else:
    i += 1

print(ans)

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

ans = 'Good'

while i-1 < range(s):
  if s[i] == s[i+1]:
    ans = 'Bad'
    print(ans)
    break
  elif :
    i += 1
    
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions

a,b,c,d = map(int,input().split())

ans = 0

if c % d == 0:
    print((b - a + 1) - ((b)//d - (a-1)//d))
elif d % c == 0:
    print((b - a + 1) - ((b)//c - (a-1)//c))
else:
    tot = c * d // fractions.gcd(c, d)
    tmp = ((b) // d - (a-1) // d) + ((b)//c - (a-1)//c) - ((b) // tot - (a-1) // tot)
    print(int((b - a + 1) - tmp))

Buggy submission (verdict: Runtime Error):
mport fractions
 
a,b,c,d = map(int,input().split())
 
ans = 0
 
if c % d == 0:
    print((b - a + 1) - ((b)//d - (a-1)//d))
elif d % c == 0:
    print((b - a + 1) - ((b)//c - (a-1)//c))
else:
    tot = c * d // fractions.gcd(c, d)
    tmp = ((b) // d - (a-1) // d) + ((b)//c - (a-1)//c) - ((b) // tot - (a-1) // tot)
    print(int((b - a + 1) - tmp))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

ans = 0

if c % d == 0:
    print((b - a + 1) - ((b)//d - (a-1)//d))
elif d % c == 0:
    print((b - a + 1) - ((b)//c - (a-1)//c))
else:
    tot = c * d // math.gcd(c, d)
    tmp = ((b) // d - (a-1) // d) + ((b)//c - (a-1)//c) - ((b) // tot - (a-1) // tot)
    print(int((b - a + 1) - tmp))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

ans = 0

if c % d == 0:
    print((b - a + 1) - (b//d - a//d))
elif d % c == 0:
    print((b - a + 1) - (b//c - a//c))
else:
    tot = c * d // math.gcd(c, d)
    tmp = (b // d - a // d) + (b//c - a//c) - (b // tot - a // tot)
    print(int((b - a + 1) - tmp))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

ans = 0

if c % d == 0:
    print((b - a + 1) - (b//d - a//d))
elif d % c == 0:
    print((b - a + 1) - (b//c - a//c))
else:
    tot = c * d // math.gcd(c, d)
    tmp = (b // d - a // d) + (b//c - a//c) - (b // tot - a // tot)
    print(int((b - a + 1) - tmp))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

ans = 0

if c % d == 0:
    print((b - a + 1) - (b//d - a//d))
elif d % c == 0:
    print((b - a + 1) - (b//c - a//c))
else:
    tot = c * d / math.gcd(c, d)
    tmp = (b // d - a // d) + (b//c - a//c) - (b // tot - a // tot)
    print(int((b - a + 1) - tmp))
Problem p03000 (python)

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

d = 0
ans = 0

if d <= x:
    ans = 1
else:
    ans = 0

for i in range(n):
    d += li[i]
    if d <= x:
        ans += 1

print(ans)

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

d = 0
ans = 0

for i in range(n):
    if d <= x:
        ans += 1
        d += li[i]
    else
        d += li[i]

print(ans)

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

d = 0
ans = 0

for i in range(n):
    if d <= x:
        ans += 1
        d += li[i]
    else
        d += li[i]

return(ans)
Problem p03001 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    s = list(map(int,input().split()))

    if (s[0] / 2.0 == s[2]) and (s[1] / 2.0 == s[3]):
        print(s[0] * s[1] / 2.0, 1)
    else:
        print(s[0] * s[1] / 2.0, 0)

if __name__ == '__main__':
    main()

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

S1 = min(l1[0] * li[3], l1[0] * (li[1] - li[3]))
S2 = min(li[2] * li[1], (li[0] - li[2]) * li[1])

if S1 == S2:
    print(S1, 1)
else:
    print(min(S1, S2), 0)

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

S1 = min(l1[0] * li[2], l1[0] * (li[1] - li[2]))
S2 = min(li[1] * li[3], li[1] * (li[0] - li[3]))

if S1 == S2:
    print(S1, 1)
else:
    print(min(S1, S2), 0)
Problem p02993 (python)

Fixed submission:
a = input()
if (a[0]==a[1]) or (a[1]==a[2]) or (a[2]==a[3]):
  print("Bad")
else :
  print("Good")

Buggy submission (verdict: Runtime Error):
a = input()
if (a[0]==a[1]) or (a[1]==a[2]) or (a[2]==a[3]):
  print("Bad")
else :
  print(Good)
Problem p03029 (python)

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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
  x,y = input().split()
  a.append([x,-int(y),i+1])
a.sort()
for i in range(n):
  print(a[i][2])
Problem p03068 (python)

Fixed submission:
a = int(input())
b = input()
c = int(input())
d = b[c-1]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = input()
c = int(input())
d = b[c]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H=input(), W=input()
H=int(H),W=int(W)
h=input(),w=input() 
h=int(h),w=int()
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H=input()
H=int(H)
h=input()
h=int(h)
W=input()
W=int(W)
w=input()
w=int(w)
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H=input()
h=input()
W=input()
w=input()
x=(int(H)-int(h))*(int(W)-int(w))
ptint(x)

Buggy submission (verdict: Runtime Error):
H=input()
h=input()
W=input()
w=input()
x=(int(H)-int(h))*(int(W)-int(w))

Buggy submission (verdict: Runtime Error):
x=(W-w)*(H-h)

Buggy submission (verdict: Runtime Error):
x=(H-h-)*(W-w)
Problem p04043 (python)

Fixed submission:
A,B,C = map(int, input().split())
if A*B*C/175==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = input().split()
if A*B*C/145==1:
  print("YES")
else:
  print("NO")
Problem p02993 (python)

Fixed submission:
import sys
N = input()

if len(N) <= 1:
    print('Good')
    sys.exit()

for i in range(1, len(N)):
    if N[i] == N[i-1]:
        print('Bad')
        sys.exit()

print('Good')

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

if len(N) <= 1:
    print('Good')
    sys.exit()

for i in range(1, len(N)):
    if N[i] == N[i-1]:
        print('Bad')
        sys.exit()

print('Good')
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print("even" if a * b % 2 == 0 else "odd")
Problem p03470 (python)

Fixed submission:
N = int(input())
D = [input() for _ in range(N)]

print(len(set(D)))

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

for a in range(N):
    for b in range(N - a):
        c = N - a - b
        if 0 <= c <= 2000 & 10000 * a + 5000 * b + 1000 * c == Y:
            print(a,b,c)
            exit()

print(-1, -1, -1)
Problem p03731 (python)

Fixed submission:
N, T = map(int, input().split())
L = [int(i) for i in input().split()]
gap=[]
time=T

for i in range(N-1):
	gap.append(L[i+1]-L[i])

for i in range(N-1):
	time += min(gap[i],T)

print(time)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
L = [int(i) for i in input().split()]
gap=[]
time=T

for i in range(N-1)
	gap.append(L[i+1]-L[i])

for i in range(N-1):
	time += min(B[i],T)

print(time)
Problem p03206 (python)

Fixed submission:
d = int(input())
if d==25:
    print('Christmas')
elif d== 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
elif d == 22:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l1='BPPPB'
for i in range(n-1):
    l2 = 'B'+l1+'P'+l1+'B'
    l1 = l2
y = l1[:x].count('P')
print(y)

Buggy submission (verdict: Runtime Error):
d = int(input())
if d=25:
    print('Christmas')
elif d= 24:
    print('Christmas Eve')
elif d = 23:
    print('Christmas Eve Eve')
elif d = 22:
    print('Christmas Eve Eve Eve')
Problem p02994 (python)

Fixed submission:
N,L = [int(i) for i in input().split()] 
bi=None
if 2<=1-L and 1-L<=N:
    bi =1-L
elif 1-L>=N:
    bi = N
elif 2>=1-L:
    bi =1
ajis = [L+i for i in range (N)]
org_sum = sum(ajis)
ans = org_sum -(L+bi-1)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = [int(i) for i in input().split()] 
bi=None
if 2<=1-L and 1-L<=N:
    bi =1-L
elif 1-L>=N:
    bi = N
elif 2>=1-L:
    bi =1
ajis = [L+i for i in range (N)]
org_sum = sum(ajis)
ans = org_sum -(L+bi-1)
print(ans)
Problem p03006 (python)

Fixed submission:
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
if N==1:
    print(1)
    exit()
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0])
print(N-d)

Buggy submission (verdict: Runtime Error):
#XY = [[1,1],[1,2],[2,2],[2,1]]
#N = len(XY)
if N==1:
    print(1)
    exit()
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0])
print(N-d)

Buggy submission (verdict: Runtime Error):
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0])
print(N-d)

Buggy submission (verdict: Runtime Error):
#XY = [[1,1],[1,2],[2,2],[2,1]]
#N = len(XY)
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0])
print(N-d)

Buggy submission (verdict: Runtime Error):
#XY = [[1,2],[1,1],[2,2],[2,1],[3,1],[3,2]]
#N = len(XY)
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0]/2)
print(N-d)

Buggy submission (verdict: Runtime Error):
#XY = [[1,2],[1,1],[2,2],[2,1],[3,1],[3,2]]
#N = len(XY)
N=int(input())
XY =  [list(map(int, input().split())) for _ in range(N)]
vecs = [  (x[0]-y[0], x[1]-y[1]) for y in XY   for x in XY]
pattern = list(set(vecs))
pattern.remove((0,0))
pattern2 = tuple(pattern)
qty = map(lambda x: vecs.count(x), pattern2)
data = zip(qty, pattern)
data2 = list(data)
data2.sort()
d = int(data2[-1][0]/2)
N-d
Problem p03023 (python)

Fixed submission:
N=int(input())
print(180*N-360)

Buggy submission (verdict: Runtime Error):
180*N-360
Problem p03067 (python)

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

if a<c<b or a>c>b:
    print("Yes")
else:
    print("No")

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

ans = 0
for i in range(n-2):
    if s[i]+s[i+1] == "#.":
        if s[i+2] == "#":
            s.replace(s[i+1],"#")
            ans += 1
        if s[i+2] == ".":
            s.replace(s[i+1],".")
            ans += 1
if s[-2]+s[-1] == "#.":
    s.replace(s[i+1],"#")
    ans += 1
print(ans)
Problem p03227 (python)

Fixed submission:
s = str(input())

if len(s) == 2:
    print(s)
else:
    print(s[::-1])

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

if len(s) == 2:
    print(s)
else:
    print(s[::-1])
Problem p02995 (python)

Fixed submission:
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D:
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D ;
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))

Buggy submission (verdict: Runtime Error):
import numpy as np
 
A,B,C,D = map(int,input().split())
lcm = int(C * D/ np.gcd(C,D))
A = A-1
A_n = A - (A//C + A//D - A//lcm)
B_n = B - (B//C + B//D - B//lcm)
print(int(B_n-A_n))

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())
lcm = int(C * D/ math.gcd(C,D))
A = A-1
A_n = A - (A//C + A//D - A//lcm)
B_n = B - (B//C + B//D - B//lcm)
print(int(B_n-A_n))
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    print(b)
elif a>=6 and a<=12:
    print(round(b/2))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
list_and = list(range(1,N+1,1))
for i in range(M):
    L, R = list(map(int, input().split()))
    list_temp = list(range(L,R+1,1))
    list_and = list(set(list_and) & set(list_temp))
print(len(list_and))
Problem p03106 (python)

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

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

list_A = make_divisor_list(A)
list_B = make_divisor_list(B)

list_and = set(list_A) & set(list_B)

list_and_sort = sorted(list_and, reverse=True)

print(list_and_sort[K-1])

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

import sympy as sym
list_A = sym.divisors(A)
list_B = sym.divisors(B)

list_and = set(list_A) & set(list_B)

list_and_sort = sorted(list_and, reverse=True)

print(list_and_sort[K-1])