Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,k = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    mod=10**9+7
    sum=0    
    def we_want(x):
        ans=1
        for i in range(k-1):
            ans=ans*(x-i)*pow(i+1,mod-2,mod)%mod 
        return ans 
        
    def check_min(i):
        if n-i>=k:
            minf=-we_want(n-1-i)*A[i]
            return minf
        else:return 0
    def check_max(i):
        if i>=k-1:
            maxf=we_want(i)*A[i]        
            return maxf
        else:return 0
    for i in range(len(A)):
        sum+=check_min(i)+check_max(i)
        sum%=mod
    print(sum%mod)

if __name__=='__main__':
    main()

Fixed submission:
n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
mod = 10 ** 9 + 7
b = 1
ans = 0
for i in range(k - 1, n):
    ans += b * (a[i] - a[n - i - 1])
    ans %= mod
    b = (i+1)*pow(i-k+2, mod - 2, mod) * b % mod
print(ans)

Buggy python submission (verdict: Runtime Error):
def main():
    n,k = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    mod=10**9+7
    sum=0    
    def we_want(x):
        ans=1
        for i in range(k-1):
            ans=ans*(x-i)*pow(i+1,mod-2,mod)%mod 
        return ans 
        
    def check_min(i):
        if n-i>=k:
            minf=-we_want(n-1-i)*A[i]
            return minf
    def check_max(i):
        if i>=k-1:
            maxf=we_want(i)*A[i]        
            return maxf
    for i in range(len(A)):
        sum+=check_min(i)+check_max(i)
        sum%=mod
    print(sum%mod)

if __name__=='__main__':
    main()

Fixed submission:
n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
mod = 10 ** 9 + 7
b = 1
ans = 0
for i in range(k - 1, n):
    ans += b * (a[i] - a[n - i - 1])
    ans %= mod
    b = (i+1)*pow(i-k+2, mod - 2, mod) * b % mod
print(ans)

Buggy python submission (verdict: Runtime Error):
def main():
    n,k = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    mod=10**9+7
    min_sum=max_sum=0    
    def we_want(x):
        ans=1
        for i in range(k-1):
            ans=ans*(x-i)*pow(i+1,mod-2,mod)%mod 
        return ans 
        
    def check_min(i):
        if n-i>=k:
            min_sum+=we_want(n-1-i)*A[i]
            min_sum%=mod
    def check_max(i):
        if i>=k-1:
            max_sum+=we_want(i)*A[i]        
            max_sum%=mod
    for i in range(len(A)):
        check_min(i)
        check_max(i)
    print((max_sum-min_sum)%mod)

if __name__=='__main__':
    main()

Fixed submission:
n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
mod = 10 ** 9 + 7
b = 1
ans = 0
for i in range(k - 1, n):
    ans += b * (a[i] - a[n - i - 1])
    ans %= mod
    b = (i+1)*pow(i-k+2, mod - 2, mod) * b % mod
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n= int(input())
xy = [list(map(int,input().split())) for _ in range(n)]
x = np.array([hs[i][0] for i in range(n)])
y = np.array([hs[i][1] for i in range(n)])

eps = 10**(-7)
while rx-lx>eps and ry-ly>eps:
    midx=(rx+lx)/2
    midy=(ry+ly)/2
    
    radius_mid_mid=(((x-midx)**2+(y-midy)**2)**0.5).max()
    radius_r_mid=(((x-rx)**2+(y-midy)**2)**0.5).max()
    radius_mid_r=(((x-midx)**2+(y-ry)**2)**0.5).max()
    radius_r_r=(((x-rx)**2+(y-ry)**2)**0.5).max() 
    r_max=min(radius_mid_mid, radius_mid_r, radius_r_mid, radius_r_r)
    if r_max==radius_r_r:
        lx=midx/2
        ly=midy/2
    elif r_max==radius_mid_r:
        rx=midx*1.5
        ly=midy/2 
    elif r_max==radius_r_mid:
        lx=midx/2
        ry=midx*1.5
    else:
        rx=midx*1.5
        ry=midy*1.5    
print((((x-rx)**2+(y-midy)**2)**0.5).max())

Fixed submission:
from math import sqrt 
n= int(input())
xy=[[int(i) for i in input().split()] for _ in range(n)]
def d(x, y):
    return sqrt((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2)
def nai(x, y, z):
    c,b,a = sorted([d(x, y), d(y, z), d(z, x)])
    co = (b**2 + c**2 - a**2)/(2*b*c)
    if co<0: return a/2
    si = sqrt(1-co**2)
    return a/si/2

if n==2:
    print(d(xy[0],xy[1])/2)
else:
    ans=0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                ans = max(ans,nai(xy[i],xy[j],xy[k]))
    print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n= int(input())
xy = [list(map(int,input().split())) for _ in range(n)]
x = np.array([hs[i][0] for i in range(n)])
y = np.array([hs[i][1] for i in range(n)])

eps = 10**(-7)
while rx-lx>eps and ry-ly>eps:
    midx=(rx+lx)/2
    midy=(ry+ly)/2
    
    radius_mid_mid=(((x-midx)**2+(y-midy)**2)**0.5).max()
    radius_r_mid=(((x-rx)**2+(y-midy)**2)**0.5).max()
    radius_mid_r=(((x-midx)**2+(y-ry)**2)**0.5).max()
    radius_r_r=(((x-rx)**2+(y-ry)**2)**0.5).max() 
    r_max=min(radius_mid_mid, radius_mid_r, radius_r_mid, radius_r_r)
    if r_max==radius_r_r:
        lx=midx
        ly=midy
    elif r_max==radius_mid_r:
        rx=midx
        ly=midy 
    elif r_max==radius_r_mid:
        lx=midx
        ry=midx
    else:
        rx=midx
        ry=midy    
print((((x-rx)**2+(y-midy)**2)**0.5).max())

Fixed submission:
from math import sqrt 
n= int(input())
xy=[[int(i) for i in input().split()] for _ in range(n)]
def d(x, y):
    return sqrt((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2)
def nai(x, y, z):
    c,b,a = sorted([d(x, y), d(y, z), d(z, x)])
    co = (b**2 + c**2 - a**2)/(2*b*c)
    if co<0: return a/2
    si = sqrt(1-co**2)
    return a/si/2

if n==2:
    print(d(xy[0],xy[1])/2)
else:
    ans=0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                ans = max(ans,nai(xy[i],xy[j],xy[k]))
    print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans+1)//2)


Fixed submission:
import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans+1)//2)

Buggy python submission (verdict: Runtime Error):
from math import gcd 
def ma():
    return map(int,input().split())
N,M=ma()
A=list(ma())
temp=A[0]//2

for i in range(N-1):
    temp=temp*(A[i+1]//2)//gcd(temp,(A[i+1]//2))
M+=temp 
ans=M//(2*temp)
print(ans)

Fixed submission:
import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans+1)//2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
i,k=0,1
while i<n:
  if a[i]==k:
    k+=1
    i+=1
  else:
    i+=1
if k==1:
  print(-1)
else:
  print(n-k+1)


Fixed submission:
a=int(input())
b=int(input())

c=[1,2,3]
c[a-1]=0
c[b-1]=0

print(max(c))
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())

def lcm(x, y):
 
   #  获取最大的数
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
print(lcm(a,b))


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

def lcm(x, y):
 
   #  获取最大的数
   if x > y:
       lower = y
   else:
       lower = x
 
   while(True):
       if((x % lower == 0) and (y % lower == 0)):
           lcm = x*y//lower
           break 
       lower -= 1
 
   return lcm
print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
a, b=map(int,input().split())
print(gcd(a,b))

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

def lcm(x, y):
 
   #  获取最大的数
   if x > y:
       lower = y
   else:
       lower = x
 
   while(True):
       if((x % lower == 0) and (y % lower == 0)):
           lcm = x*y//lower
           break 
       lower -= 1
 
   return lcm
print(lcm(a,b))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
g=[0]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1==1:
            g[j]+=1

cnt=0
for i in range(60):
    now=g[i]
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
g=[0]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1==1:
            g[j]+=1

cnt=0
for i in range(60):
    now=g[i]
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
g=[[0] for i in range(n)]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1:
            g[j][i]=1

cnt=0
for i in range(60):
    now=g[i].count(1)
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
g=[0]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1==1:
            g[j]+=1

cnt=0
for i in range(60):
    now=g[i]
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
*a=map(int,input().split())
g=[[0] for i in range(n)]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1:
            g[j][i]=1

cnt=0
for i in range(60):
    now=g[i].count(1)
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
g=[0]*60
mod=10**9+7
for i in range(n):
    for j in range(60):
        if (a[i]>>j)&1==1:
            g[j]+=1

cnt=0
for i in range(60):
    now=g[i]
    cnt+=now*(n-now)*(2**i)
    cnt%=mod

print(cnt)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
dp=[[0 for i in range(w+1)] for j in range(h+1)]

A=[list(map(int,input().split())) for j in range(w)]
B=[list(map(int,input().split())) for j in range(w)]
C=[[abs(A[i][j]-B[i][j]) for j in range(h)] for i in range(w)]    

for i in range(h):
    for j in range(w):
        now=C[i][j]
        dp[i+1][j+1]=min(abs(dp[i][j+1]-now),abs(dp[i+1][j]-now))

print(dp[h][w])

Fixed submission:
import sys 
def input():return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
H,W=map(int,input().split())
A=[[int(x) for x in input().split()] for _ in range(H)]
B=[[int(x) for x in input().split()] for _ in range(H)]
C=[[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        C[i][j]=abs(A[i][j]-B[i][j])
center=80 * (H + W)
dp=[[0]*W for _ in range(H)]
dp[0][0]=(1<<(center - C[0][0]))|(1<<(center+C[0][0]))
for i in range(H):
    for j in range(W):
        if i:
            dp[i][j]|=dp[i-1][j]<<C[i][j]
            dp[i][j]|=dp[i-1][j]>>C[i][j]
        if j:
            dp[i][j]|=dp[i][j-1]<<C[i][j]
            dp[i][j]|=dp[i][j-1]>>C[i][j]            
ans=center*2
for i in range(center*2):
    if (dp[H-1][W-1]>>i)&1:
        ans=min(ans,abs(i-center))
print(ans)

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
dp=[[[0] for i in range(w+1)] for j in range(h+1)]

A=[list(map(int,input().split())) for j in range(w)]
B=[list(map(int,input().split())) for j in range(w)]
C=[[abs(A[i][j]-B[i][j]) for j in range(h)] for i in range(w)]    

for i in range(h):
    for j in range(w):
        now=C[i+1][j+1]
        dp[i+1][j+1]=min(abs(dp[i][j+1]-now),abs(dp[i+1][j]-now))

print(dp[h][w])

Fixed submission:
import sys 
def input():return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
H,W=map(int,input().split())
A=[[int(x) for x in input().split()] for _ in range(H)]
B=[[int(x) for x in input().split()] for _ in range(H)]
C=[[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        C[i][j]=abs(A[i][j]-B[i][j])
center=80 * (H + W)
dp=[[0]*W for _ in range(H)]
dp[0][0]=(1<<(center - C[0][0]))|(1<<(center+C[0][0]))
for i in range(H):
    for j in range(W):
        if i:
            dp[i][j]|=dp[i-1][j]<<C[i][j]
            dp[i][j]|=dp[i-1][j]>>C[i][j]
        if j:
            dp[i][j]|=dp[i][j-1]<<C[i][j]
            dp[i][j]|=dp[i][j-1]>>C[i][j]            
ans=center*2
for i in range(center*2):
    if (dp[H-1][W-1]>>i)&1:
        ans=min(ans,abs(i-center))
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    n=int(input())
    s=input()
    sum=''
    model='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    m=list(model)
    for i in range(len(s)):
        now=m.index(s[i])
        sum=sum+m[now+n]
    print(sum)


if __name__=='__main__':
    main()   def main():
    

Fixed submission:
def main():
    n=int(input())
    s=input()
    sum=''
    model='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    m=list(model)
    for i in range(len(s)):
        now=m.index(s[i])
        sum=sum+m[now+n]
    print(sum)


if __name__=='__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print((int(input())**2)

Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Runtime Error):
import math;n = int(input());l = [list(map(int,input().split())) for i in range(n)];dist = 0
for x1,y1 in l:for x2,y2 in l:dist += math.sqrt((x1-x2)**2 + (y1-y2)**2)
print(dist/n)


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

import math
sum=0  
for j in range(n):
  q=c[j][0];w=c[j][1]
  for k in range(j):
    sum+=math.sqrt((c[k][0]-q)**2+(c[k][1]-w)**2)
    
print(float(sum*2/n))

Buggy python submission (verdict: Runtime Error):
n=int(input())
c=list([]*n)
for i in range(n):
  a,b=map(int,input().split())
  c[i].append(a)
  c[i].append(b)

import cmath
sum=0  
for j in range(n):
  q=c[j][0];w=c[j][1]
  for k in range(j):
    sum+=cmath.sqrt((c[k][0]-q)**2+(c[k][1]-w)**2)
    
print(float(sum*2/n))    

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

import math
sum=0  
for j in range(n):
  q=c[j][0];w=c[j][1]
  for k in range(j):
    sum+=math.sqrt((c[k][0]-q)**2+(c[k][1]-w)**2)
    
print(float(sum*2/n))
Buggy python submission (verdict: Runtime Error):
def gho1(x):
  g=1
  for i in range(1,x+1):
    g*=i
  return g
def gho2(x):
  g=1
  for i in range(1,x+1):
    g*=i;g=g%(10**9+7)
  return g

q,w=map(int,input().split())
e,d=divmod((2*w-q),3)
r,f=divmod((2*q-w),3)

if d!=0 or f!=0:print(0)
else:
  print((gho(e+r)//(gho(e)*gho(r)))%(10*9+7))


Fixed submission:
x,y=map(int,input().split());n=0;mod=10**9+7;ans=0
if not (x+y)%3:
  n=(x+y)//3;x-=n;y-=n
  if x>=0 and y>=0:
    ans=1
    for i in range(x):ans=ans*(n-i)*pow(i+1,mod-2,mod)%mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def gho(x):
  g=1
  for i in range(1,x+1):
    g*=i
  return g

q,w=map(int,input().split())
e,d=divmod((2*w-q),3)
r,f=divmod((2*q-w),3)

if d!=0 or f!=0:print(0)
else:
  print((gho(e+r)//(gho(e)*gho(r)))%(10*9+7))

Fixed submission:
x,y=map(int,input().split());n=0;mod=10**9+7;ans=0
if not (x+y)%3:
  n=(x+y)//3;x-=n;y-=n
  if x>=0 and y>=0:
    ans=1
    for i in range(x):ans=ans*(n-i)*pow(i+1,mod-2,mod)%mod
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
v=a*a*b/2
import math
k=(2*v-x)*2/(a*b)
g=2*x/(a*b)
if x<=v:
  print(math.atan(b/g)*180/math.pi)
else:
  print(math.atan(b/k)*180/math.pi)

Fixed submission:
a,b,x=map(int,input().split())
v=a*a*b/2
import math
k=(2*v-x)*2/(a*a)
g=2*x/(a*b)
if x<=v:
  print(math.atan(b/g)*180/math.pi)
else:
  print(math.atan(k/a)*180/math.pi)

Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
v=a*a*b/2
k=(v-x)/(a*b)
g=x/(a*b)
if x<=v:
  print(math.atan(b/g)*180/math.pi)
else:
  print(math.atan(b/k)*180/math.pi)

Fixed submission:
a,b,x=map(int,input().split())
v=a*a*b/2
import math
k=(2*v-x)*2/(a*a)
g=2*x/(a*b)
if x<=v:
  print(math.atan(b/g)*180/math.pi)
else:
  print(math.atan(k/a)*180/math.pi)
Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from collections import accumulate as acc
import operator as op
import copy as cp
import math 

n=ri()
s=input()
cnt=n
if n==1:
  print(1)
  
else:
  for i in range(n-1):
    if s[i]==s[i+1]:
      cnt-=1
  print(cnt)


Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from itertools import accumulate as acc
import operator as op
import copy as cp
import math 

n=ri()
s=input()
cnt=n
if n==1:
  print(1)
  
else:
  for i in range(n-1):
    if s[i]==s[i+1]:
      cnt-=1
  print(cnt)

Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from collections import accumulate as acc
import operator as op
import copy as cp
import math 

n=ri()
s=input()
cnt=n
if n==1:
  print(1)
  
else:
  for i in range(n-1):
    if s[i]==s[i+1]:
      cnt-=1
  print(cnt)

Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from itertools import accumulate as acc
import operator as op
import copy as cp
import math 

n=ri()
s=input()
cnt=n
if n==1:
  print(1)
  
else:
  for i in range(n-1):
    if s[i]==s[i+1]:
      cnt-=1
  print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))

cnt=0
n=ri()
lu=rli()
lu.sort()
if n<=2:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      r=n
      l=j
      if lu[-1]<lu[i]+lu[j]:
        cnt+=n-1-j
        continue
      if lu[j+1]>lu[j]+lu[i]:
        continue
      
      while r-l>1 :
        mid=(r+l)//2
        if lu[i]+lu[j]>lu[mid]:
          l=mid
        else:
          r=mid
      cnt+=l-j
  print(cnt)


Fixed submission:
n=int(input())
l=sorted(map(int,input().split()))
from bisect import *
print(sum(bisect_left(l,l[i]+l[j])-i-1 for i in range(n) for j in range(i)))

Buggy python submission (verdict: Time Limit Exceeded):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
from itertools import accumulate as acc
import operator as op
import copy as cp
import math 


cnt=0
n=ri()
lu=rli()
lu.sort()
if n<=2:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      r=n
      l=j
      
      while r-l>1 :
        mid=(r+l)//2
        if lu[i]+lu[j]>lu[mid]:
          l=mid
        else:
          r=mid
      cnt+=l-j
  print(cnt)

Fixed submission:
n=int(input())
l=sorted(map(int,input().split()))
from bisect import *
print(sum(bisect_left(l,l[i]+l[j])-i-1 for i in range(n) for j in range(i)))
Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
def nli(x):return [input for _ in range(x)]
def hukusuu(): 
  listA=[] #appendのために宣言が必要
  while True:
    try:listA.append(list(map(int,input().split())))
    except:break #または、quit(),os.exit()をして止める。
  return listA

n,k=ma()
h=rli()

from itertools import accumulate , groupby as acc , gp
import operator as op
import copy as cp
import math
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
def ifif(s):
  if s:print("Yes")
  else:print("No")

h.sort()
inde=bisl(h,k)
print(n-inde)  




Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
def nli(x):return [input for _ in range(x)]
def hukusuu(): 
  listA=[] #appendのために宣言が必要
  while True:
    try:listA.append(list(map(int,input().split())))
    except:break #または、quit(),os.exit()をして止める。
  return listA

n,k=ma()
h=rli()

from itertools import accumulate as acc 
import operator as op
import copy as cp
import math
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
def ifif(s):
  if s:print("Yes")
  else:print("No")

h.sort()
inde=bisl(h,k)
print(n-inde)
Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
def nli(x):return [input for _ in range(x)]
def hukusuu(): 
  listA=[] #appendのために宣言が必要
  while True:
    try:listA.append(list(map(int,input().split())))
    except:break #または、quit(),os.exit()をして止める。
  return listA
from itertools import accumulate as acc 
import operator as op
import copy as cp
import math
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
def ifif(s):
  if s:print("Yes")
  else:print("No")

n=ri()  
a=rli()
b=[0]*n
for k in range(len(a))
  b(a[k])=k

print(" ".join(b))

Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
def nli(x):return [input for _ in range(x)]
def hukusuu(): 
  listA=[] #appendのために宣言が必要
  while True:
    try:listA.append(list(map(int,input().split())))
    except:break #または、quit(),os.exit()をして止める。
  return listA
from itertools import accumulate as acc 
import operator as op
import copy as cp
import math
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
def ifif(s):
  if s:print("Yes")
  else:print("No")

n=ri()  
a=rli()
b=[0]*n
for k in range(len(a)):
  b[a[k]-1]=str(k+1)

print(" ".join(b))
Buggy python submission (verdict: Time Limit Exceeded):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
def nli(x):return [input for _ in range(x)]
def hukusuu(): 
  listA=[] #appendのために宣言が必要
  while True:
    try:listA.append(list(map(int,input().split())))
    except:break #または、quit(),os.exit()をして止める。
  return listA
from itertools import accumulate as acc 
import operator as op
import copy as cp
import math
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
def ifif(s):
  if s:print("Yes")
  else:print("No")
def primes(x):
      if x < 2: return []
      primes = [i for i in range(x)]
      primes[1] = 0 # 1は素数ではない
      for prime in primes:
          if prime > math.sqrt(x): break
          if prime == 0: continue
          for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0
      return [prime for prime in primes if prime != 0]
def euclid(x,y):
  if x%y==0:
    return y
  else:
    return euclid(y,x%y)

a,b=ma()
a,b=min(a,b),max(a,b)
gcdab=euclid(b,a)

#print(gcdab)
#print(primes(gcdab+1))
b=[]
hoshii=[aru for aru in primes(gcdab+1) if gcdab%aru==0]
#print(hoshii)
print(len(hoshii)+1)

Fixed submission:
from fractions import *;g=gcd(*map(int,input().split()));c=i=1
while i*i<=g and g>1:
  i+=1;c+=g%i<1
  while g%i<1:g/=i
print(c+(g>1))