Problem p03006 (python)

Fixed submission:
#from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
result = {0:0}
#md = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            result[(p,q)] = result.get((p,q), 0)+1
            #md[(p,q)] += 1
#print(result)
print(n - max(result.values()))
#print(md)
#print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
#result = {0:0}
md = defaultdict(int)
#md[0] = 0
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            #result[(p,q)] = result.get((p,q), 0)+1
            md[(p,q)] += 1
#print(result)
#print(n - max(result.values()))
#print(md)
print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
#from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
#result = {0:0}
md = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            #result[(p,q)] = result.get((p,q), 0)+1
            md[(p,q)] += 1
#print(result)
#print(n - max(result.values()))
#print(md)
print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
result = {}
md = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            result[(p,q)] = result.get((p,q), 0)+1
            md[(p,q)] += 1
#print(result)
print(n - max(result.values()))
#print(md)
#print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
di.sort(reverse = True)
result = {}
md = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            result[(p,q)] = result.get((p,q), 0)+1
            md[(p,q)] += 1
#print(result)
print(n - max(result.values()))
#print(md)
#print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
di.sort(reverse = True)
result = {}
md = defaultdict(int)
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            p = di[i][0] - di[j][0]
            q = di[i][1] - di[j][1]
            result[(p,q)] = result.get((p,q), 0)+1
            md[(p,q)] += 1
#print(result)
#print(max(result.values()))
#print(md)
print(n - max(md.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
di.sort(reverse = True)
result = []
for i in range(n-1):
    result.append([di[i][0]-di[i+1][0], di[i][1]-di[i+1][1]])
result.sort()
counter = []
z = 1
c = 1
hantei = result[0]
while z <= n-1:
    if z < n-1:
        if hantei == result[z]:
            c += 1
            z += 1
        else:
            counter.append(c)
            c = 1
            hantei = result[z]
            z += 2
    else:
        counter.append(c)
        z += 1
print(n-max(counter))

Buggy submission (verdict: Runtime Error):
n = int(input())
di = [list(map(int, input().split(' '))) for _ in range(n)]
di.sort(reverse = True)
result = []
for i in range(n-1):
    result.append([di[i][0]-di[i+1][0], di[i][1]-di[i+1][1]])
result.sort()
counter = []
z = 1
c = 1
hantei = result[0]
while z <= n-1:
    if z < n-1:
        if hantei == result[z]:
            c += 1
            z += 1
        else:
            counter.append(c)
            c = 1
            hantei = result[z]
            z += 1
    else:
        counter.append(c)
        z += 1
print(n-max(counter))