Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

class BIT(object):
    def __init__(self, N, init=0):
        self.N = N
        self.bit = [init for _ in range(N)]

    def add(self, k, w):
        x = k
        while x < self.N:
            self.bit[x] += w
            x |= x + 1

    def sum(self, k):
        s = 0
        x = k - 1
        while x >= 0:
            s += self.bit[x]
            x = (x & (x + 1)) - 1
        return s

n = int(input())
s = list(input())
q = int(input())

d = defaultdict(lambda: BIT(n))
for i, si in enumerate(s):
    d[si].add(i, 1)

for i in range(q):
    k, x, y = input().split()
    if k == '1':
        x = int(x) - 1
        d[s[x]].add(x, -1)
        d[y].add(x, 1)
        s[x] = y
    else:
        l = int(x) - 1
        r = int(y) - 1
        ans = 0
        for v in d.values():
            ans += (v.sum(r + 1) - v.sum(l)) > 0
        print(ans)


Fixed submission:
from collections import defaultdict

class BIT(object):
    def __init__(self, N, init=0):
        self.N = N
        self.bit = [init for _ in range(N)]

    def add(self, k, w):
        x = k
        while x < self.N:
            self.bit[x] += w
            x |= x + 1

    def sum(self, k):
        s = 0
        x = k - 1
        while x >= 0:
            s += self.bit[x]
            x = (x & (x + 1)) - 1
        return s

n = int(input())
s = list(input())
q = int(input())

d = defaultdict(lambda: BIT(n))
for i, si in enumerate(s):
    d[si].add(i, 1)

for i in range(q):
    k, x, y = input().split()
    if k == '1':
        x = int(x) - 1
        d[s[x]].add(x, -1)
        d[y].add(x, 1)
        s[x] = y
    else:
        l = int(x) - 1
        r = int(y) - 1
        ans = 0
        for v in d.values():
            ans += (v.sum(r + 1) - v.sum(l)) > 0
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
for i in range(n - k + 1):
    x = 0
    for j in range(k):
        pj = p[i + j]
        x += (1 + pj) / 2
    ans = max(ans, x)
print(ans)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
a = [0 for _ in range(n + 1)]
for i, pi in enumerate(p):
    a[i + 1] = a[i] + (1 + pi) / 2

ans = 0
for i in range(n - k + 1):
    ans = max(ans, a[i + k] - a[i])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
h, n = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
a, b = x[0]
dp = [-(-i // a) * b for i in range(h + 1)]
for j in range(1, n):
    a, b = x[j]
    for i in range(h + 1):
        if i >= a:
            dp[i] = min(dp[i], dp[i - a] + b)
        else:
            dp[i] = min(dp[i], b)
print(dp[-1])


Fixed submission:
h, n = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
a, b = x[0]
dp = [-(-i // a) * b for i in range(h + 1)]
for j in range(1, n):
    a, b = x[j]
    for i in range(min(h + 1, a)):
        dp[i] = min(dp[i], b)
    for i in range(a, h + 1):
        dp[i] = min(dp[i], dp[i - a] + b)
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
h, n = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
a, b = x[0]
dp = [[-(-i // a) * b for i in range(h + 1)] for j in range(2)]
for j in range(1, n):
    a, b = x[j]
    for i in range(h + 1):
        if i >= a:
            dp[j % 2][i] = min(dp[1 - j % 2][i], dp[1 - j % 2][i - a] + b)
        else:
            dp[j % 2][i] = min(dp[1 - j % 2][i], b)
print(dp[j % 2][-1])


Fixed submission:
h, n = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
a, b = x[0]
dp = [-(-i // a) * b for i in range(h + 1)]
for j in range(1, n):
    a, b = x[j]
    for i in range(min(h + 1, a)):
        dp[i] = min(dp[i], b)
    for i in range(a, h + 1):
        dp[i] = min(dp[i], dp[i - a] + b)
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
def warshall_floyd(V, E):
    INF = 10 ** 9
    d = [[0 for _ in range(V + 1)]] + [[0] + [INF for j in range(V)] for i in range(V)]
    for i in range(V + 1):
        d[i][i] = 0
    for i, j in E:
        d[i][j] = 1
        d[j][i] = 1
    for k in range(1, V + 1):
        for i in range(1, V):
            for j in range(i, V + 1):
                dk = d[i][k] + d[k][j]
                if d[i][j] > dk:
                    d[i][j] = dk
                    d[j][i] = dk
    return d


h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
n = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            n += 1
            s[i][j] = n
        else:
            s[i][j] = 0


E = []
for i in range(h):
    for j in range(w):
        p = s[i][j]
        if p > 0:
            if j < w - 1:
                p1 = s[i][j + 1]
                if p1 > 0:
                    E.append([p, p1])
            if i < h - 1:
                p2 = s[i + 1][j]
                if p2 > 0:
                    E.append([p, p2])

ans = 0
INF = 10 ** 9
D = warshall_floyd(n, E)
ans = max(list(map(max, D)))
print(ans)


Fixed submission:
def warshall_floyd(V, E):
    INF = 10 ** 9
    d = [[0 for _ in range(V + 1)]] + [[0] + [INF for j in range(V)] for i in range(V)]
    for i in range(V + 1):
        d[i][i] = 0
    for i, j in E:
        d[i][j] = 1
        d[j][i] = 1
    for k in range(1, V + 1):
        for i in range(1, V):
            for j in range(i, V + 1):
                dk = d[i][k] + d[k][j]
                if d[i][j] > dk:
                    d[i][j] = dk
                    d[j][i] = dk
    return d


h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
n = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            n += 1
            s[i][j] = n
        else:
            s[i][j] = 0


E = []
for i in range(h):
    for j in range(w):
        p = s[i][j]
        if p > 0:
            if j < w - 1:
                p1 = s[i][j + 1]
                if p1 > 0:
                    E.append([p, p1])
            if i < h - 1:
                p2 = s[i + 1][j]
                if p2 > 0:
                    E.append([p, p2])

ans = 0
INF = 10 ** 9
D = warshall_floyd(n, E)
ans = max(list(map(max, D)))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
class combnk_mod(object):
    # pが素数かつaとpが互いに素であるとき
    # フェルマーの小定理より以下が成り立つ.
    # 1 / a = a ** (p - 2) (mod p)
    # これを使って (1 / k!) mod p を計算する.
    def __init__(self, maxn, p):
        self.maxn = maxn
        self.p = p
        self.x = [1] # 分母にあたる数 1 / n! mod p
        self.y = [1] # 分子にあたる数. n! mod p
        for i in range(1, self.maxn + 1):
            self.x.append(self.x[-1] * pow(i, self.p - 2, self.p) % self.p)
            self.y.append(self.y[-1] * i % self.p)

    def combnk(self, n, k):
        if n < k:
            return 0
        return (self.x[n - k] * self.x[k] * self.y[n]) % self.p

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
MOD = 10 ** 9 + 7
combnk = combnk_mod(n, MOD)
ans = 0

if k == 2:
    for i in range(n - 1):
        ai = a[i]
        for j in range(i + 1, n):
            aj = a[j]
            ans += (aj - ai) % MOD
            ans %= MOD
elif k > 2:
    for i in range(n - 1):
        ai = a[i]
        for j in range(i + 1, n):
            aj = a[j]
            f = aj - ai
            m = j - i - 1
            if m >= k - 2:
                ans += f * combnk.combnk(m, k - 2) % MOD
                ans %= MOD
print(ans)


Fixed submission:
class combnk_mod(object):
    # pが素数かつaとpが互いに素であるとき
    # フェルマーの小定理より以下が成り立つ.
    # 1 / a = a ** (p - 2) (mod p)
    # これを使って (1 / k!) mod p を計算する.
    def __init__(self, maxn, p):
        self.maxn = maxn
        self.p = p
        self.x = [1] # 分母にあたる数 1 / n! mod p
        self.y = [1] # 分子にあたる数. n! mod p
        for i in range(1, self.maxn + 1):
            self.x.append(self.x[-1] * pow(i, self.p - 2, self.p) % self.p)
            self.y.append(self.y[-1] * i % self.p)

    def combnk(self, n, k):
        if n < k:
            return 0
        return (self.x[n - k] * self.x[k] * self.y[n]) % self.p

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
MOD = 10 ** 9 + 7
combnk = combnk_mod(n, MOD)
ans = 0
if k == 1:
    print(0)
else:
    x = [0 for _ in range(n)]
    y = [combnk.combnk(i, k - 2) for i in range(n + 1)]
    ya = [0]
    for yi in y:
        ya.append(ya[-1] + yi)

    for i in range(n):
        end = i + k - 1
        x[i] = ya[i] - ya[max(0, n - i - 1)]
    for xi, ai in zip(x, a):
        ans += xi * ai % MOD
        ans %= MOD
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [[0 for j in range(2)] for i in range(L)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        x[j][int(s)] += 1
b = 1
for i, (x0, x1) in enumerate(x):
    ans += x0 * x1 * b % MOD
    ans %= MOD
    b *= 2
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [0 for i in range(L)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        if s == '1':
            x[j] += 1
b = 1
for i, xi in enumerate(x):
    ans += xi * (n - xi) * b % MOD
    ans %= MOD
    b *= 2
    b %= MOD
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [[0 for j in range(2)] for i in range(L)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        x[j][int(s)] += 1
for i, (x0, x1) in enumerate(x):
    ans += x0 * x1 * 2 ** i % MOD
    ans %= MOD
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [0 for i in range(L)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        if s == '1':
            x[j] += 1
b = 1
for i, xi in enumerate(x):
    ans += xi * (n - xi) * b % MOD
    ans %= MOD
    b *= 2
    b %= MOD
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [[0 for j in range(60)] for i in range(2)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        x[int(s)][j] += 1
for i in range(60):
    x0 = x[0][i]
    x1 = x[1][i]
    y = x0 * x1
    ans += y * 2 ** i % MOD
    ans %= MOD
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
L = len(format(max(a), 'b'))
x = [0 for i in range(L)]
ans = 0
MOD = 10 ** 9 + 7
for i in a:
    i_str = list(format(i, '0' + str(L) + 'b'))[::-1]
    for j, s in enumerate(i_str):
        if s == '1':
            x[j] += 1
b = 1
for i, xi in enumerate(x):
    ans += xi * (n - xi) * b % MOD
    ans %= MOD
    b *= 2
    b %= MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
def is_cross(la, lb, x1, x2):
    ya1 = la[0] * x1 + la[1]
    ya2 = la[0] * x2 + la[1]
    yb1 = lb[0] * x1 + lb[1]
    yb2 = lb[0] * x2 + lb[1]
    if ya1 == yb1:
        return False
    return (ya1 - yb1) * (ya2 - yb2) <= 0

def get_line(c, x, y):
    return [c, y - c * x]

t = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xa = sum([ti * ai for ti, ai in zip(t, a)])
xb = sum([ti * bi for ti, bi in zip(t, b)])
if xa / sum(t) == xb / sum(t):
    print('infinity')
else:
    ans = 0
    t_pre = 0
    da = 0
    db = 0
    while(True):
        ans_t = 0
        for ti, ai, bi in zip(t, a, b):
            t_post = t_pre + ti
            la = get_line(ai, t_pre, da)
            lb = get_line(bi, t_pre, db)
            ans_t += is_cross(la, lb, t_pre, t_post)
            t_pre = t_post
            da += ti * ai
            db += ti * bi

        if ans_t == 0:
            break
        ans += ans_t
    print(ans)


Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

print(int(m2 == m1 + 1 and d2 == 1))
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
a_max = max([y[1] for y in x])

dp_pre = [0 for j in range(t + a_max)]
dp = [0 for j in range(t + a_max)]
for ai, bi in x:
    for j in range(ai):
        dp[j] = dp_pre[j]
    for j in range(ai, t + ai):
        dp[j] = max(dp_pre[j], dp_pre[j - ai] + bi)
    for j in range(t + ai, t + a_max):
        dp[j] = dp_pre[j]
    dp_pre, dp = dp, dp_pre
print(max(dp_pre))


Fixed submission:
n, t = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
x.sort()
a_max = x[-1][0]

dp_pre = [0 for j in range(t + a_max)]
dp = [0 for j in range(t + a_max)]
for ai, bi in x:
    for j in range(ai):
        dp[j] = dp_pre[j]
    for j in range(ai, t + ai):
        dp[j] = max(dp_pre[j], dp_pre[j - ai] + bi)
    for j in range(t + ai, t + a_max):
        dp[j] = dp_pre[j]
    dp_pre, dp = dp, dp_pre
print(max(dp_pre))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        k = bisect.bisect_left(L[j + 1:], a + b)
        ans += k
print(ans)


Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        k = bisect.bisect_left(L[j + 1:], a + b)
        ans += k
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        for k in range(j + 1, n):
            c = L[k]
            if c < a + b:
                ans += 1
            else:
                break
print(ans)


Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        k = bisect.bisect_left(L[j + 1:], a + b)
        ans += k
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        for k in range(j + 1, n):
            c = L[k]
            if a < b + c and b < c + a and c < a + b:
                ans += 1
print(ans)


Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        k = bisect.bisect_left(L[j + 1:], a + b)
        ans += k
print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

def factrize(n):
    b = []
    while n % 2 == 0:
        if len(b) == 0 or b[-1] != f:
            b.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if len(b) == 0 or b[-1] != f:
                b.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        b.append(n)
    return b

a, b = map(int, input().split())
d = gcd(a, b)
p = factrize(d)
print(len(p) + 1)


Fixed submission:
from fractions import gcd

def factrize(n):
    b = []
    while n % 2 == 0:
        b.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            b.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        b.append(n)
    return b

a, b = map(int, input().split())
d = gcd(a, b)
p = factrize(d)
p_unique = set(p)
print(len(p_unique) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(m):
    x = a.pop()
    bisect.insort(a, x // 2)
print(sum(a))


Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: -int(x), input().split()))
heapq.heapify(a)
for i in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a, -1 * (-x // 2))
print(-1 * sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0
for l in range(n):
    ss = s[l:]
    length = n - l
    i, j = 1, 0
    a = [0 for _ in range(length)]
    while i < length:
        while i + j < length and ss[j] == ss[i + j]:
            j += 1
        a[i] = j
        if j == 0:
            i += 1
            continue
        k = 1
        while i + k < length and k + a[k] < j:
            a[i + k] = a[k]
            k += 1
        i += k
        j -= k
    amax = max(a)
    ans = max(ans, min(n // 2, amax))
print(ans)


Fixed submission:
n = int(input())
s = input()
ans = 0
for l in range(n):
    ss = s[l:]
    length = n - l
    i, j = 1, 0
    a = [0 for _ in range(length)]
    while i < length:
        while i + j < length and ss[j] == ss[i + j]:
            j += 1
        a[i] = j
        if j == 0:
            i += 1
            continue
        k = 1
        while i + k < length and k + a[k] < j:
            a[i + k] = a[k]
            k += 1
        i += k
        j -= k
    for ll, al in enumerate(a):
        if al <= ll:
            ans = max(ans, al)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
dpi = dp[0]
for i, si in enumerate(s):
    dpi1 = dp[i + 1]
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dpi[j]
        for k in k_list:
            dpi1[(j * 10 + k) % 13] += xij
    for j in range(13):
        dpi1[j] %= MOD
    dpi = dpi1
print(dp[-1][5])


Fixed submission:
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
dpi = dp[0]
for i, si in enumerate(s):
    dpi1 = dp[i + 1]
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dpi[j]
        for k in k_list:
            dpi1[(j * 10 + k) % 13] += xij
    for j in range(13):
        dpi1[j] %= MOD
    dpi = dpi1
print(dp[-1][5])

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
for i, si in enumerate(s):
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dp[i][j]
        for k in k_list:
            dp[i + 1][(j * 10 + k) % 13] += xij
    for j in range(13):
        dp[i + 1][j] %= MOD
print(dp[-1][5])


Fixed submission:
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
dpi = dp[0]
for i, si in enumerate(s):
    dpi1 = dp[i + 1]
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dpi[j]
        for k in k_list:
            dpi1[(j * 10 + k) % 13] += xij
    for j in range(13):
        dpi1[j] %= MOD
    dpi = dpi1
print(dp[-1][5])

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
for i, si in enumerate(s):
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dp[i][j]
        for k in k_list:
            dp[i + 1][(j * 10 + k) % 13] += dp[i][j]
    for j in range(13):
        dp[i + 1][j] %= MOD
print(dp[-1][5])


Fixed submission:
MOD = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for j in range(13)] for i in range(n + 1)]
dp[0][0] = 1
dpi = dp[0]
for i, si in enumerate(s):
    dpi1 = dp[i + 1]
    if si == '?':
        k_list = range(10)
    else:
        k_list = [int(si)]
    for j in range(13):
        xij = dpi[j]
        for k in k_list:
            dpi1[(j * 10 + k) % 13] += xij
    for j in range(13):
        dpi1[j] %= MOD
    dpi = dpi1
print(dp[-1][5])
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

int main(){
    int x, a;
    cin >> x >> a;
    if (x < a) cout << 0 << endl;
    else cout << 10 << endl;
}


Fixed submission:
x, a = map(int, input().split())
if x < a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

n = int(input())
z = [list(map(int, input().split())) for _ in range(n)]
d = defaultdict(int)
for i in range(n):
    xi, yi = z[i]
    for j in range(n):
        if i == j:
            continue
        xj, yj = z[j]
        d[(xi - xj, yi - yj)] += 1
print(n - max(d.values()))


Fixed submission:
from collections import defaultdict

n = int(input())
z = [list(map(int, input().split())) for _ in range(n)]
if n == 1:
    ans = 1
else:
    d = defaultdict(int)
    for i in range(n):
        xi, yi = z[i]
        for j in range(n):
            if i == j:
                continue
            xj, yj = z[j]
            d[(xi - xj, yi - yj)] += 1
    ans = n - max(d.values())
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
dp = [0 for i in range(n + 1)]
dp[0] = 1
MOD = 10 ** 9 + 7
if a[0] > 1:
    dp[1] = 1
for i in range(2, n + 1):
    if i - 1 not in a:
        dp[i] += dp[i - 1]
    if i - 2 not in a:
        dp[i] += dp[i - 2]
    dp[i] %= MOD
print(dp[-1])


Fixed submission:
n, m = map(int, input().split())
if m > 0:
    a = {int(input()): None for i in range(m)}
else:
    a = {}
dp = [0] * (n + 1)
dp[0] = 1
MOD = 10 ** 9 + 7
if m == 0 or 1 not in a:
    dp[1] = 1
for i in range(2, n + 1):
    if i - 1 not in a:
        dp[i] += dp[i - 1]
    if i - 2 not in a:
        dp[i] += dp[i - 2]
    dp[i] %= MOD
print(dp[-1])