Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#%%
inf = 10**9 + 7
import numpy as np

def p(x):
    tmp = (bin(x)[2:])
    l = len(tmp)
    ans = '0'*(70-l) + tmp
    return ans


n = int(input())
a = list(map(int, input().split()))
count = np.array([0] * 70)
for i in range(n):
    tmp = np.array(list(p(a[i])))
    #print(tmp)
    count[tmp=='1'] += 1


ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)



Fixed submission:
#%%
inf = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))
count = [0] * 70
for i in range(n):
    tmp = list(str(bin(a[i])[2:]))[::-1]
    #print(tmp)
    for j in range(len(tmp)):
        if tmp[j] == '1':
            k = 69 - j
            count[k] += 1

#print(count)

ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)



# %%

Buggy python submission (verdict: Time Limit Exceeded):
#%%
inf = 10**9 + 7
import numpy as np

n = int(input())
a = list(map(int, input().split()))
count = np.array([0] * 70)
for i in range(n):
    tmp = np.array(list(map(int, (bin(a[i])[2:].zfill(70)))))
    count[tmp==1] += 1


ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)


# %%


Fixed submission:
#%%
inf = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))
count = [0] * 70
for i in range(n):
    tmp = list(str(bin(a[i])[2:]))[::-1]
    #print(tmp)
    for j in range(len(tmp)):
        if tmp[j] == '1':
            k = 69 - j
            count[k] += 1

#print(count)

ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)



# %%

Buggy python submission (verdict: Time Limit Exceeded):
#%%
inf = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))
count = [0] * 70
for i in range(n):
    tmp = list(str(bin(a[i])[2:]))[::-1]
    #print(tmp)
    for j in range(len(tmp)):
        if tmp[j] == '1':
            k = 69 - j
            count[k] += 1

#print(count)

ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)



# %%


Fixed submission:
#%%
inf = 10**9 + 7

n = int(input())
a = list(map(int, input().split()))
count = [0] * 70
for i in range(n):
    tmp = list(str(bin(a[i])[2:]))[::-1]
    #print(tmp)
    for j in range(len(tmp)):
        if tmp[j] == '1':
            k = 69 - j
            count[k] += 1

#print(count)

ans = 0
for i in range(70):
    k = 2 ** (69 - i)
    k %= inf
    x = count[i] % inf
    y = (n - x) % inf
    ans += (x * y * k) % inf
    ans %= inf

ans %= inf
print(ans)



# %%
Buggy python submission (verdict: Runtime Error):
#%%
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

x = (a1-b1) * t1
y = x + (a2-b2) * t2

if y == 0:
    ans = 'infinity'
else:
    if x < 0 and y > 0 :
        ans = (abs(x//y) + 1) * 2 - 3
    elif x > 0 and y < 0 :
        ans = (abs(x//y) + 1) * 2 - 3

print(ans)

Fixed submission:
#%%
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

x = (a1-b1) * t1
y = x + (a2-b2) * t2
#print(x, y)

def p(x, y):
    if x%y == 0:
        return abs(x//y)
    else:
        return abs(x//y) + 1

if y == 0:
    ans = 'infinity'
else:
    if x%y != 0:
        if x < 0 and y > 0 :
            ans = (abs(x//y) + 1) * 2 - 3
        elif x > 0 and y < 0 :
            ans = (abs(x//y) + 1) * 2 - 3
        else:
            ans = 0
    else:
        if x < 0 and y > 0 :
            ans = (abs(x//y) + 1) * 2 - 2
        elif x > 0 and y < 0 :
            ans = (abs(x//y) + 1) * 2 - 2
        else:
            ans = 0


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#%%
n, m = map(int, input().split())
s = list(input())
s = s[::-1]

ans = []
tmp = 0
for i in range(n+1):
    last = tmp
    for j in range(0, m):
        j = m - j
        if tmp + j >= len(s): continue

        if s[tmp + j] == "0":
            tmp += j
            ans.append(str(j))
            break
    if last == tmp and last != len(s)-1:
        ans = -1
        break
if ans != -1:
    ans = ans[::-1]
    ans = ' '.join(ans)
    
print(ans)



Fixed submission:
n, m = map(int, input().split())
s = list(input())
s = s[::-1]
ans_list = []

for i in range(n+1):
    if i == 0:
        tmp_count = 0
        tmp_ans = 0
    else:
        tmp_count += 1
        if s[i] == '0':
            tmp_ans = tmp_count
        if tmp_count == m:
            ans_list.append(tmp_ans)
            tmp_count -= tmp_ans
            tmp_ans = tmp_count

if 1 <= tmp_ans <= m:
    ans_list.append(tmp_ans)
if ans_list.count(0) >= 1:
    ans_list = [-1]
    
for i in range(len(ans_list)):
    ans_list[i] = str(ans_list[i])
ans_list = ans_list[::-1]
print(' '.join(ans_list))
Buggy python submission (verdict: Runtime Error):
#%%
import math 

a, b, x = map(int, input().split())
if x >= a*a*b/2:
    y = 2*(b-x/(a**2))
    ans = math.degrees(math.atan(a/y))
    print(90 - ans)
else:
    y = 2*(x/(a*b))
    ans = math.degrees(math.atan(y/b))
    print(90 - ans)

Fixed submission:
#%%
import math 

a, b, x = map(int, input().split())
if x == a*a*b:
    print(0)
elif x >= a*a*b/2:
    y = 2*(b-x/(a**2))
    ans = math.degrees(math.atan(a/y))
    print(90 - ans)
else:
    y = 2*(x/(a*b))
    ans = math.degrees(math.atan(y/b))
    print(90 - ans)

Buggy python submission (verdict: Runtime Error):
#%%

#%%
n = int(input())

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

l = factorize(n)


import itertools
c = list(itertools.product(range(2), repeat=len(l)))
#print(c)

flag = False
k = 10**15
for i in range(len(c)):
    a = 1
    b = 1
    for j in range(len(c[i])):
        if c[i][j] == 0:
            a *= l[j]
        else:
            b *= l[j]
    k = min(k, a+b)
    

print(k-2)


Fixed submission:
#%%
import math 

a, b, x = map(int, input().split())
if x == a*a*b:
    print(0)
elif x >= a*a*b/2:
    y = 2*(b-x/(a**2))
    ans = math.degrees(math.atan(a/y))
    print(90 - ans)
else:
    y = 2*(x/(a*b))
    ans = math.degrees(math.atan(y/b))
    print(90 - ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())

dp = [[0] * n for _ in range(n)]
for i in range(n-1, -1, -1):
    for j in range(n-1, -1, -1):
        if s[i] == s[j]:
            if j+1 <= n-1 and i+1 <= n-1:
                dp[i][j] = dp[i+1][j+1] + 1
            else:
                dp[i][j] = 1
                
for i in range(n):
    for j in range(n):
        dp[i][j] = min(abs(i-j), dp[i][j])

ans = 0
for i in range(n):
    ans = max(ans, max(dp[i]))
print(ans)

Fixed submission:
a = input()
if a == 'Sunny':
    ans = 'Cloudy'
elif a == 'Cloudy':
    ans = 'Rainy'
else:
    ans = 'Sunny'

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())

dp = [[0] * n for _ in range(n)]
for i in range(n-1, -1, -1):
    for j in range(n-1, -1, -1):
        if s[i] == s[j]:
            if j+1 <= n-1 and i+1 <= n-1:
                dp[i][j] = dp[i+1][j+1] + 1
            else:
                dp[i][j] = 1
                
for i in range(n):
    for j in range(n):
        dp[i][j] = min(abs(i-j), dp[i][j])

ans = 0
for i in range(n):
    ans = max(ans, max(dp[i]))
print(ans)

Fixed submission:
n = int(input())
s = list(input())

dp = [[0] * n for _ in range(n)]
for i in range(n-1, -1, -1):
    for j in range(n-1, -1, -1):
        if s[i] == s[j]:
            if j+1 <= n-1 and i+1 <= n-1:
                dp[i][j] = dp[i+1][j+1] + 1
            else:
                dp[i][j] = 1
                
for i in range(n):
    for j in range(n):
        dp[i][j] = min(abs(i-j), dp[i][j])

ans = 0
for i in range(n):
    ans = max(ans, max(dp[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
alpha2num = lambda c: ord(c) - ord('a') + 1

N = int(input())
S = input()
S = list(S)

ans = ''
len_ans = 0

alpha = 'abcdefghijklmnopqrstuvwxyz'
alpha = list(alpha)

l = [0] * 27
c = []

#for i in alpha:
#    tmp = [j for j, x in enumerate(S) if x == i]
#    if len(tmp) >= 2:
#        for j in range(len(tmp)):
#            l.append(tmp[j])



for i in range(len(alpha)):
    tmp = [j for j, x in enumerate(S) if x == alpha[i]]
    if len(tmp) >= 2:
        l[i+1] = (len(tmp))
        for j in range(len(tmp)):
            c.append(tmp[j])
c.sort()

#print(l)
#print(c)

t = [0] * 27

ans = []

#print(N)
for i in range(N):
    t = [0] * 27
    for j in range(i, N):
        if t[alpha2num(S[j])] + 1 <= l[alpha2num(S[j])]//2:
            t[alpha2num(S[j])] += 1
            if j == N-1:
                ans.append(''.join(S[i:j+1]))

        else: 
            ans.append(''.join(S[i:j]))
            break

#print(ans)
ans2 = [x for x in set(ans) if ans.count(x) > 1]
#print(ans2) 


ans = 0
for i in range(len(ans2)):
    tmp = len(ans2[i])
    ans = max(ans, tmp)

print(ans)

Fixed submission:
n = int(input())
s = list(input())

dp = [[0] * n for _ in range(n)]
for i in range(n-1, -1, -1):
    for j in range(n-1, -1, -1):
        if s[i] == s[j]:
            if j+1 <= n-1 and i+1 <= n-1:
                dp[i][j] = dp[i+1][j+1] + 1
            else:
                dp[i][j] = 1
                
for i in range(n):
    for j in range(n):
        dp[i][j] = min(abs(i-j), dp[i][j])

ans = 0
for i in range(n):
    ans = max(ans, max(dp[i]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

#%%
import heapq

N, M = map(int, input().split())
l = [0] * N
for i in range(N):
    l[i] = list(map(int, input().split()))

l.sort()
#print(l)

L = [[] for _ in range(M+1)]
for i in range(N):
    if l[i][0] <= M:
        L[l[i][0]].append(l[i][1]) 

#print(L)


a = []
ans = []
for i in range(M+1):
    for j in range(len(L[i])):
        heapq.heappush(a, -L[i][j])
    heapq.heapify(a)
    if len(a) != 0:
        ans.append(heapq.heappop(a))

print(-sum(ans))

#%%


Fixed submission:

#%%
import heapq

N, M = map(int, input().split())
l = [0] * N
for i in range(N):
    l[i] = list(map(int, input().split()))

l.sort()
#print(l)

L = [[] for _ in range(M+1)]
for i in range(N):
    if l[i][0] <= M:
        L[l[i][0]].append(l[i][1]) 

#print(L)


a = []
ans = 0
for i in range(M+1):
    for j in range(len(L[i])):
        heapq.heappush(a, -L[i][j])
    if len(a) != 0:
        ans += heapq.heappop(a)

print(-ans)

#%%
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = len(str(N))
ans = 0

if l%2 == 0:
    for i in range(0, l, 2):
        ans += 9*(10**i)
else:
    for i in range(0,l-2, 2):
        ans += 9*(10**i)
        #print(ans)
    ans += N - int('9'*(len(str(N))-1))

print(ans)
#print(l)

Fixed submission:
N = int(input())
l = len(str(N))
ans = 0

if l != 1:
    if l%2 == 0:
        for i in range(0, l, 2):
            ans += 9*(10**i)
    else:
        for i in range(0,l-2, 2):
            ans += 9*(10**i)
            #print(ans)
        ans += N - int('9'*(len(str(N))-1))
else:
    ans = N

print(ans)
#print(l)

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = len(str(N))
ans = 0

if l%2 == 0:
    for i in range(0, l, 2):
        ans += 9*(10**i)
else:
    for i in range(0,l-2, 2):
        ans += 9*(10**i)
        #print(ans)
    ans += N - int('9'*(len(str(N))-1))

print(ans)
#print(l)

Fixed submission:
N = int(input())
l = len(str(N))
ans = 0

if l != 1:
    if l%2 == 0:
        for i in range(0, l, 2):
            ans += 9*(10**i)
    else:
        for i in range(0,l-2, 2):
            ans += 9*(10**i)
            #print(ans)
        ans += N - int('9'*(len(str(N))-1))
else:
    ans = N

print(ans)
#print(l)
Buggy python submission (verdict: Runtime Error):
S = list(input())
N = len(S)

RL = []
LR = []



for i in range(N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        RL.append(i)
    if S[i] == 'L' and S[i+1] == 'R':
        LR.append(i)

#print(RL)
#print(LR)

if S[0] == 'L':
    RL.insert(0,0)
if S[-1] == 'R':
    RL.append(N-1)

LR.insert(0, -1)
LR.append(N-1)

#print('RL 記入')
#print(RL)
#print('LR 区切り')
#print(LR)

ans = ['0'] * N
for i in range(len(LR)-1):
    tmp = LR[i+1] - LR[i]
    if RL[i] == 0:
        ans[0] = tmp
    elif RL[i] == N-1:
        ans[N-1] = tmp
        RL.remove(N-1)
    else:
        tmplist = S[LR[i]+1:LR[i+1]+1]
        tmpR = tmplist.count('R')
        tmpL = tmplist.count('L')
        #print(tmplist)

        if (tmpR + tmpL) % 2 == 0:
            ans[RL[i]] = str(tmp // 2)
            ans[RL[i]+1] = str(tmp // 2)
        elif tmpR %2 == 1 and tmpL%2==0:
            ans[RL[i]] = str(tmp // 2 + 1)
            ans[RL[i]+1] = str(tmp // 2 )
        elif tmpR %2 == 0 and tmpL%2==1:
            ans[RL[i]] = str(tmp // 2 )
            ans[RL[i]+1] = str(tmp // 2 + 1)

print(' '.join(ans))




Fixed submission:
S = list(input())
N = len(S)

RL = []
LR = []



for i in range(N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        RL.append(i)
    if S[i] == 'L' and S[i+1] == 'R':
        LR.append(i)

#print(RL)
#print(LR)

#if S[0] == 'L':
#    RL.insert(0,0)
#if S[-1] == 'R':
#    RL.append(N-1)

LR.insert(0, -1)
LR.append(N-1)

#print('RL 記入')
#print(RL)
#print('LR 区切り')
#print(LR)

ans = ['0'] * N
for i in range(len(LR)-1):
    tmp = LR[i+1] - LR[i]
#    if RL[i] == 0:
#        ans[0] = str(tmp)
#    elif RL[i] == N-1:
#        ans[N-1] = str(tmp)
#        RL.remove(N-1)
#    else:
    tmplist = S[LR[i]+1:LR[i+1]+1]
    tmpR = tmplist.count('R')
    tmpL = tmplist.count('L')
    #print(tmplist)

    if (tmpR + tmpL) % 2 == 0:
        ans[RL[i]] = str(tmp // 2)
        ans[RL[i]+1] = str(tmp // 2)
    elif tmpR %2 == 1 and tmpL%2==0:
        ans[RL[i]] = str(tmp // 2 + 1)
        ans[RL[i]+1] = str(tmp // 2 )
    elif tmpR %2 == 0 and tmpL%2==1:
        ans[RL[i]] = str(tmp // 2 )
        ans[RL[i]+1] = str(tmp // 2 + 1)

print(' '.join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
#%%
import bisect

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

ans_list = []
for i in range(n):
    tmp = bisect.bisect_left(ans_list, a[i])
    #print(tmp)
    if tmp == 0:
        ans_list.insert(0, a[i])
    else:
        ans_list[tmp-1] = a[i]
    #print(ans_list)
print(len(ans_list))

    


Fixed submission:
#%%
import bisect

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())

ans_list = [-1] * n
for i in range(n):
    tmp = bisect.bisect_left(ans_list, a[i])
    #print(tmp)
    if tmp == 0:
        ans_list.insert(0, a[i])
    else:
        ans_list[tmp-1] = a[i]
    #print(ans_list)

ans = 0
for i in range(n):
    if ans_list[i] != -1:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
d = list(map(int, input().split()))
N = d[0]
A = d[1]
B = d[2]

if N*A >= B :
    return(B)
else:
    return(N*A)

Fixed submission:
d = list(map(int, input().split()))
N = d[0]
A = d[1]
B = d[2]

if N*A >= B :
    print(B)
else:
    print(N*A)

Buggy python submission (verdict: Runtime Error):
d = list(map(int, input().split()))
N = d[0]
A = d[1]
B = d[2]

if N*A >= B :
    return(N*A)
else:
    return(B)

Fixed submission:
d = list(map(int, input().split()))
N = d[0]
A = d[1]
B = d[2]

if N*A >= B :
    print(B)
else:
    print(N*A)
Buggy python submission (verdict: Runtime Error):
d = list(map(int, input().split()))
L = d[0]
R = d[1]

a = L//2019
b = L//2019
c = L%2019
d = R%2019

list = []

if b-a >= 2:
  print(0)

elif b - a == 1:
  if d - c >= 0:
    print(0)
  else:
    for i in range(c,d+2019):
      for j in range(i+1,d+2019+1):
        list.append(i*j%2019)
    print(min(list)) 

else :
  for i in range(c,d):
    for j in range(i+1,d+1):
        list.append(i*j%2019)
  print(min(list)) 

Fixed submission:
d = list(map(int, input().split()))
L = d[0]
R = d[1]

a = L//2019
b = R//2019
c = L%2019
d = R%2019

list = []

if b-a >= 2:
  print(0)

elif b-a == 1:
  if d >= c:
    print(0)
  else:
    for i in range(c,d+2019):
      for j in range(i+1,d+2019+1):
        list.append(i*j%2019)
    print(min(list)) 

else :
  for i in range(c,d):
    for j in range(i+1,d+1):
        list.append(i*j%2019)
  print(min(list))

Buggy python submission (verdict: Runtime Error):
d = list(map(int, input().split()))
L = d[0]
R = d[1]

if L >= 2019:
    L = L%2019
if R >= 2019:
    R = R%2019

list = []
for i in range(L,R):
    for j in range(i+1,R+1):
        list.append(i*j%2019)

print(min(list)) 

Fixed submission:
d = list(map(int, input().split()))
L = d[0]
R = d[1]

a = L//2019
b = R//2019
c = L%2019
d = R%2019

list = []

if b-a >= 2:
  print(0)

elif b-a == 1:
  if d >= c:
    print(0)
  else:
    for i in range(c,d+2019):
      for j in range(i+1,d+2019+1):
        list.append(i*j%2019)
    print(min(list)) 

else :
  for i in range(c,d):
    for j in range(i+1,d+1):
        list.append(i*j%2019)
  print(min(list))

Buggy python submission (verdict: Runtime Error):
d = list(map(int, input().split()))
L = d[0]
R = d[1]

if L >= 2019:
    L = L%2019
if R >= 2019:
    R = R%2019

list = []
for i in range(L,R+1):
    for j in range(i+1,R+1):
        list.append(i*j%2019)

print(min(list)) 

Fixed submission:
d = list(map(int, input().split()))
L = d[0]
R = d[1]

a = L//2019
b = R//2019
c = L%2019
d = R%2019

list = []

if b-a >= 2:
  print(0)

elif b-a == 1:
  if d >= c:
    print(0)
  else:
    for i in range(c,d+2019):
      for j in range(i+1,d+2019+1):
        list.append(i*j%2019)
    print(min(list)) 

else :
  for i in range(c,d):
    for j in range(i+1,d+1):
        list.append(i*j%2019)
  print(min(list))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
paskal = [[0]*N for _ in range(N)] 


for i in range(N):
    for j in range(0, i+1):
        if j == 0 or j == i:
            paskal[i][j] = 1
        else:
            paskal[i][j] = (paskal[i-1][j-1] + paskal[i-1][j]) % 1000000007



for i in range(1, K+1):
    ans = paskal[N-K+1][i] * paskal[K-1][i-1]
    print(ans)

Fixed submission:
#%%
"""
#(w+h-1) C w
a,b = 1, 1
for i in range(1, w+h-1):
    a *= i
    a %= mod
for i in range(1, w):
    b *= i
    b %= mod
for i in range(1, h):
    b *= i
    b %= mod

ans = a * pow(b, mod-2, mod) % mod
"""

n, k = map(int, input().split())
mod = 10**9 + 7

for i in range(1, k+1):
    if i <= n - k + 1: 
        a, b, c, d = 1, 1, 1, 1
        for j in range(1, n-k+1+1):
                a *= j
                a %= mod
        for j in range(1, i+1):
                b *= j
                b %= mod
        for j in range(1, n-k+1-i+1):
                b *= j
                b %= mod
        for j in range(1, k-1+1):
                c *= j
                c %= mod
        for j in range(1, i-1+1):
                d *= j
                d %= mod
        for j in range(1, k-i+1):
                d *= j
                d %= mod
        #print(a, b, c, d)
        ans = a * pow(b, mod-2, mod) * c * pow(d, mod-2, mod) 
        ans %= mod
    else:
        ans = 0
    print(ans)
Buggy python submission (verdict: Runtime Error):
#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = list(c.values())
#print(a)
a.sort(reverse=True)
print(n-a[1])

Fixed submission:
#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = list(c.values())
#print(a)
a.sort(reverse=True)


if n == 1:
    print(1)
else:
    print(n-a[1])

Buggy python submission (verdict: Runtime Error):
#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = (list(c.values())[1])
print(n-a)

Fixed submission:
#%%
import collections

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())

l = []
for i in range(n):
    for j in range(n):
        tmp = str(x[i]-x[j]) + ' ' + str(y[i]-y[j])
        l.append(tmp)

c = collections.Counter(l)
a = list(c.values())
#print(a)
a.sort(reverse=True)


if n == 1:
    print(1)
else:
    print(n-a[1])
Buggy python submission (verdict: Runtime Error):
N_M = list(map(int, input().split()))
N = N_M[0]
M = N_M[1]
dis = []
for _ in range(M):
    dis.append(input())

dp = [0 for i in range(N+2)]
dp[0] = 1
if 1 in dis:
    dp[1] = 0
else :
    dp[1] = 1

for i in range(N):
    if i+2 in dis:
        dp[i+2]=0
    else:
        if i in dis :
            dp[i+2]=dp[i+1]
        if i+1 in dis :
            dp[i+2]=dp[i]
        else :
            dp[i+2]=dp[i]+dp[i+1]

print(dp[N])

Fixed submission:
input_time = list(map(int, input().split()))
input_time_sort = sorted(input_time)
print(input_time_sort[0]+input_time_sort[1])
Buggy python submission (verdict: Runtime Error):
#%%
import numpy as np

h, w = map(int, input().split())
s = [[] for _ in range(h)]
for i in range(h):
    s[i] = list(input())
s_0 = np.array(s)
s_90 = np.rot90(s_0)
s_180 = np.rot90(s_90)
s_270 = np.rot90(s_180)

c_0 = np.zeros(h*w).reshape(h,-1)
c_0[s_0 == '.'] = 1
c_90 = np.zeros(h*w).reshape(w,-1)
c_90[s_90 == '.'] = 1
c_180 = np.zeros(h*w).reshape(h,-1)
c_180[s_180 == '.'] = 1
c_270 = np.zeros(h*w).reshape(w,-1)
c_270[s_270 == '.'] = 1

for i in range(h):
    for j in range(1, w):
        if c_0[i][j] >=  1:
            c_0[i][j] += c_0[i][j-1]
#print(c_0)

for i in range(w):
    for j in range(1, h):
        if c_90[i][j] >=  1:
            c_90[i][j] += c_90[i][j-1]
c_90 = np.rot90(np.rot90(c_90))
c_90 = np.rot90(np.rot90(np.rot90(c_90)))
#print(c_90)

for i in range(h):
    for j in range(1, w):
        if c_180[i][j] >=  1:
            c_180[i][j] += c_180[i][j-1]
c_180 = np.rot90(np.rot90(c_180))
#print(c_180)

for i in range(w):
    for j in range(1, h):
        if c_270[i][j] >=  1:
            c_270[i][j] += c_270[i][j-1]
c_270 = np.rot90(np.rot90(c_270))
c_270 = np.rot90(c_270)
#print(c_270)

c = c_0 + c_90 + c_180 + c_270 - 3
print(int(c.max()))


Fixed submission:
#%%
import numpy as np

h, w = map(int, input().split())
s = [[] for _ in range(h)]
for i in range(h):
    s[i] = list(input())
s_0 = np.array(s)
s_90 = np.rot90(s_0)
s_180 = np.rot90(s_90)
s_270 = np.rot90(s_180)

c_0 = np.zeros(h*w).reshape(h,-1)
c_0[s_0 == '.'] = 1
c_90 = np.zeros(h*w).reshape(w,-1)
c_90[s_90 == '.'] = 1
c_180 = np.zeros(h*w).reshape(h,-1)
c_180[s_180 == '.'] = 1
c_270 = np.zeros(h*w).reshape(w,-1)
c_270[s_270 == '.'] = 1


for j in range(1, w):
    c_0[:, j] += c_0[:, j-1] * c_0[:, j]
#print(c_0)

for j in range(1, h):
    c_90[:, j] += c_90[:, j-1] * c_90[:, j]
c_90 = np.rot90(np.rot90(np.rot90(c_90)))
#print(c_90)

for j in range(1, w):
    c_180[:, j] += c_180[:, j-1] * c_180[:, j]
c_180 = np.rot90(np.rot90(c_180))
#print(c_180)

for j in range(1, h):
    c_270[:, j] += c_270[:, j-1] * c_270[:, j]
c_270 = np.rot90(c_270)
#print(c_270)

c = c_0 + c_90 + c_180 + c_270 - 3
print(int(c.max()))