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

Fixed submission:
H,W = map(int, input().split())
print(1 if H*W in [H,W] else W*(H//2)+(W//2+W%2)*(H%2))

Buggy submission (verdict: Runtime Error):
    H,W = map(int, input().split())
    print(1 if H*W in [H,W] else W*(H//2)+(W//2+W%2)*(H%2))

Buggy submission (verdict: Runtime Error):
h,w= map(int, input().split())
if h%2!==0 & w%2!==0:
    print(h*((w+1)//2))
else :
    print(h*w/2)

Buggy submission (verdict: Runtime Error):
h,w= map(int, input().split())
if h%2!=0 & w%2!=0 :
    print(h*((w+1)//2))
else 
    print(h*w/2)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if 4*a*b<(c-a-b)**2 and (c-a-b)>0 else "No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c= map(int,input().split())


if math.sqrt(a)+math.sqrt(b)<math.sqrt(c):
    print('Yes')
else
    print('No')
Problem p02744 (python)

Fixed submission:
N=int(input())
A=["a"]
if N==1:
    print("a")
    exit()
else:
    S="abcdefghijklmn"
    slist=list(S) 
    for i in range(2,N+1):
        temp=[[] for _ in range(N)]
        for j in range(i-1):
            for w in A[j]:
                for u in slist[:j+1]:
                    temp[j].append(w+u)
                temp[j+1].append(w+slist[j+1])
        A=temp
    B=[]    
    for j in range(N):
        for t in A[j]:
            B.append(t)
    B.sort()
    for i in range(len(B)):
        print(B[i])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[a]
if N==1:
    print("a")
    exit()
else:
    S=abcdefghijklmn
    slist=list(S) 
    for i in range(2,N+1):
        temp=[[]*N]
        for j in range(i-1):
            for w in A[j]:
                for u in slist[:j+1]:
                    temp[j].append(w+u)
                temp[j+1].append(w+slist[j+1])
        A=temp
    for j in range(N):
        for t in A[j]:
            print(t)
Problem p02767 (python)

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
P=round(sum(X)/N)
#四捨五入
print(sum((x-P)**2 for x in X))
#listに入っているものを一つずつ取り出して、合計する

Buggy submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
P=round(sum(X)/N) #四捨五入
print(sum((x-P)**2 for x in X))　#listに入っているものを一つずつ取り出して、合計する
Problem p02768 (python)

Fixed submission:
def com(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

n, a, b = map(int,input().split())

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= com(n, a, mod)
sum -= com(n, b, mod)

print(int(sum % mod))

Buggy submission (verdict: Runtime Error):
n,a,b =map(int,input().split())
sum=0
for i in range(n) :
    if i == a :
        continue
    elif i == b :
        continue
    else :
        sum+=pow(n)/(pow(i)*pow(n-i))

print(sum%1000000007)
Problem p02787 (python)

Fixed submission:
H,n=map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(n)]
maxAi= max(a for a,b in AB)
dp=[0]*(H+maxAi)
i=1
while True:
  try:
    dp[i]=min(dp[i-a]+b for a,b in AB)
    i+=1
  except:
    print(min(dp[H:]))
    break

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
maxAi= max(a for a,b in AB)
dp=[0]*(H+maxAi)
i=1
try:
    dp[i]=min(dp[i-a]+b for a,b in AB)
    i+=1
except:
    print(min(dp[H:]))

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
maxAi= max(a for a,b in AB)
dp=[0]*(H+maxAi)
i=1
try:
    dp[i]=min(dp[i-a]+b for a,b in AB)
    i+=1
else:
    print(min(dp[H:]))
Problem p02791 (python)

Fixed submission:
n=int(input())
min=2*(10**5)
cnt=0

for i in map(int,input().split()):
    if min>=i:
         min=i
         cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
min=2*(10**5)
cnt=0

for i in map(int,input().split())
    if min>=i:min=i
    cnt+=1

print(cnt)
Problem p02797 (python)

Fixed submission:
N,K,S=map(int,input().split())
a=(S+1)%pow(10,9)

answer=[S]*K+[a]*(N-K)

print(" ".join(map(str,answer)))

Buggy submission (verdict: Runtime Error):
n, k, s=map(int,input().split())
#a= [list(map(int,input().split())) for _ in range(n)]
c=[s]*k+[-s]*(n-k)
#' '.join(c)
#d=int(c)
#print(c)
print(" ".join(map(str,answer)))
Problem p02804 (python)

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 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()

Buggy 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()
Problem p02805 (python)

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 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())

Buggy 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())
Problem p02814 (python)

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 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)

Buggy 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)
Problem p02824 (python)

Fixed submission:
def main():
    import sys 
    input= sys.stdin.readline
    n,m,v,p=map(int,input().split())
    a=list(map(int,input().split()))
    a.sort(reverse=True)
    cnt=p
    #from bisect import bisect_left
    #print(a[5]+m)
    s=sum(a[p-1:p])
    for i in range(p,n):
        if (a[i]+m )<a[p-1]:
            break
        # 3 2 2 1 1 0
        
        cnt+= ((a[i]+m)*(i-p+1)-s+(n-(i-p+1))*m)>=v*m
        try: s+=a[i]
        except: continue      
    print(cnt)

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys 
    input= sys.stdin.readline
    n,m,v,p=map(int,input().split())
    a=list(map(int,input().split()))
    a.sort(reverse=True)
    cnt=p
    #from bisect import bisect_left
    #print(a[5]+m)
    for i in range(p,n):
        if (a[i]+m )<a[p-1]:
            break
        # 3 2 2 1 1 0
        cnt+= ((a[i]+m)*(i-p+1)-sum(a[p-1:i])+(n-(i-p+1))*m)>=v*m:
              
    print(cnt)

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys 
    input= sys.stdin.readline
    n,m,v,p=map(int,input().split())
    a=list(map(int,input().split()))
    a.sort(reverse=True)
    cnt=p
    #from bisect import bisect_left
    #print(a[5]+m)
    for i in range(p,n):
        if (a[i]+m )<a[p-1]:
            break
        # 3 2 2 1 1 0
        cnt+= ((a[i]+m)*(i-p+1)-sum(a[p-1:i])+(n-(i-p+1))*m)>=v*m:
              
    print(cnt)

if __name__=='__main__':
    main()
Problem p02838 (python)

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 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)

Buggy 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)
Problem p02839 (python)

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 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])

Buggy 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])
Problem p02848 (python)

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 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():
Problem p02861 (python)

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 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)

Buggy 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))
Problem p02882 (python)

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 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)

Buggy 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)
Problem p02887 (python)

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 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)

Buggy 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)
Problem p02898 (python)

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 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)
Problem p02899 (python)

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 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))
Problem p02911 (python)

Fixed submission:
def ma():return map(int,input().split())
def nli(x):return [int(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

def ifif(s):
  if s:print("Yes")
  else:print("No")

n,k,q=ma()

b=[0]*n
for i in range(q):
  ai=int(input())-1
  b[ai]+=1 

for i in range(n):
  ifif(k-q+b[i]>0)

Buggy submission (verdict: Runtime Error):
def ma():return map(int,input().split())
def nli(x):return [int(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

def ifif(s):
  if s:print("Yes")
  else:print("No")

n,k,q=ma()

b=[0]*q
for i in range(q):
  ai=int(input())-1
  b[ai]+=1 

for i in range(q):
  ifif(k-b[i]>0)
Problem p02923 (python)

Fixed submission:
a=int(input())
d=[]
t=0
g=0
h=list(map(int,input().split()))
for i in range(a-1):
  if h[i]>=h[i+1]:
    g+=1
  else:
    d.append(g)
    g=0
d.append(g)
print(max(d))

Buggy submission (verdict: Runtime Error):
a=int(input())
d=[]
t=0
g=0
h=map(int,input().split())
for i in range(a-1):
  if h[i]>=h[i+1]:
    g+=1
  else:
    d.append(g)
    g=0
d.append(g)
print(max(d))
Problem p02934 (python)

Fixed submission:
import numpy as np
N=int(input())
A=np.array(list(map(float,input().split())))

C=A**-1
#print(C)
print((C.sum())**-1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int,input().split())
B=np.array(A)
C=B**-1
print((C.sum())**-1)
Problem p02947 (python)

Fixed submission:
import sys
from collections import Counter

n, *S = sys.stdin.read().split()
n = int(n)

def main():
    t = [''.join(sorted(t)) for t in S]
    c = Counter(t)
    cnt = 0
    for v in c.values():
        cnt += v*(v-1)
    print(cnt//2)

main()

Buggy submission (verdict: Runtime Error):
n=int(input())
from collections import defaultdict
d=defaultdict(str)
for _ in range(n):
    s=list(input())
    s.sort()
    n=''.join(s)
    d[n]+=1 
ans=0
for i in d:
    ans+=d[i]*(d[i]-1)//2

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
from collections import defaultdict
d=defaultdict(int)
for _ in range(n):
    s=list(input())
    s.sort()
    d[*s]+=1 
ans=0
for i in d:
    ans+=d[i]*(d[i]-1)//2

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
from collections import defaultdict
d=defaultdict(int)
for _ in range(n):
    s=list(input())
    s.sort()
    d[s]+=1 
ans=0
for i in d:
    ans+=d[i]*(d[i]-1)//2

print(ans)
Problem p02982 (python)

Fixed submission:
import math
n,d=map(int,input().split())
cnt=0
dlist=[list(map(int,input().split())) for _ in range(n)]
for i in range(n-1):
    for j in range(i+1,n):
        ans=0
        for k in range(d):
            ans+=(dlist[i][k]-dlist[j][k])**2
        cnt+=math.floor(ans**0.5)==math.ceil(ans**0.5)

print(cnt)

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
cnt=0
dlist=[list(map(int,input().split())) for _ in range(n)]
for i in range(n-1):
    for j in range(i+1:n):
        ans=0
        for k in range(d):
            ans+=(dlist[i][k]-dlist[j][k])**2
        cnt+=math.floor(ans**0.5)==math.ceil(ans**0.5):

print(cnt)
Problem p03031 (python)

Fixed submission:
N,M=map(int,input().split())
ks=[list(map(int,input().split())) for _ in range(M)]
p=list(map(int,input().split()))
ans=0
for s in range(1<<N):
    for j in range(M):
        cnt=0
        for h in ks[j][1:]:
            h-=1
            if (s>>h)&1:
                cnt+=1
                cnt%=2
        if cnt!=p[j]:
            break
    else:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ks=[list(map(int,input())) for _ in range(M)]
p=list(map(int,input().split()))
ans=0
for s in range(1<<M):
    for j in range(M):
        cnt=0
        for h in ks[j][1:]:
            h-=1
            if (s>>h)&1:
                cnt+=1
                cnt%=2
        if cnt!=ks[j][0]:
            break
    else:
        ans+=1
print(ans)