TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N, M = map(int,input().split())
A= [int(x) for x in input().split()]

threshold = sum(A) / (4*M)

print("threshold is ",threshold)

gokaku = 0

for i in A:
  if i >= threshold:
    gokaku +=1

if gokaku >= M:
  print("Yes")
else:
  print("No")

N, M = map(int,input().split())
A= [int(x) for x in input().split()]

threshold = sum(A) / (4*M)

gokaku = 0

for i in A:
  if i >= threshold:
    gokaku +=1

if gokaku >= M:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
# coding: utf-8

n, m = map(int, input().split())

a_list = list(map(int, input().split()))

border = sum(a_list) / (4 * m)

a_choiced_list = [a for a in a_list if a > border]

print(len(a_choiced_list))
if len(a_choiced_list) < m:
    print('No')
else:
    print('Yes')


# coding: utf-8

n, m = map(int, input().split())

a_list = list(map(int, input().split()))

border = sum(a_list) / (4 * m)

a_choiced_list = [a for a in a_list if a >= border]

if len(a_choiced_list) < m:
    print('No')
else:
    print('Yes')


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        continue

if f >= c:
    print("Yes")
else :
    print("No")

b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        break

if f >= c:
    print("Yes")
else :
    print("No")

b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f = c:
    print("Yes")
else :
    print("No")

a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in sorted(c,reverse=True):
    if d>=required:
        count+=1
    else:
        break
print("YNeos"[count<b::2])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
a,b = map(int, input().split())
c = list(map(int,input().split()))

d = sum(c)
e = sorted(c,reverse=True)

for i in range(a):
  if(e[i]<d/4*b):
    print("No")
    exit()
print("Yes")

a,b = map(int, input().split())
c = list(map(int,input().split()))

d = sum(c)
e = sorted(c,reverse=True)

for i in range(b):
  if(e[i]<d/(4*b)):
    print("No")
    exit()
print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
import numpy as np

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    a = np.asarray(A[:M])
    for i in a:
        print(i)
        print(sum(A)/(M*4))
        if i >= sum(A)/(M*4):
            ret = "Yes"
            continue
        else:
            ret = "No"
            break
    print(ret)

    

import numpy as np

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    a = np.asarray(A[:M])
    for i in a:
        if i >= sum(A)/(M*4):
            ret = "Yes"
            continue
        else:
            ret = "No"
            break
    print(ret)


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
for aa in a:
  if aa>=sum(a)/4m:
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')

n,k=map(int,input().split())
while n>=0:
  n=abs(n-k)
  if n-k<=0:
    print(abs(n))
    break

n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
sum=sum(a)
for aa in a:
  if aa>=sum/4/m:
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M = input().split()
A = list(map(int,input().split()))
tv = sum(A)
i,count=0,0
while(i<N and count!=M):
  if(A[i]>int(tv/4*int(M))):
    count+=1
if(count==M):
  print("YES")
else:
  print("NO")

N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
req = int(tot_votes//(4*M))
count = 0
i = 0
while(count!=M and i<N):
    if(A[i]>req):
        count+=1
    i+=1
if(count<=M):
    print("No")
else:
    print("Yes")

N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
count = 0
for a in A:
    if(a>=tot_votes/(4*M)):
        count+=1
if(count>=M):
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
print(sum/(4.*int(n)))
if int(b[int(m)-1]) < sum/(4.*int(n)):
    print("No")
else:
    print("Yes")


a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) > sum/4:
    print(True)
else:
    print(False)


n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum//(4*int(m)):
        yy+=1
if yy >= int(m):
    print("No")
else:
    print("Yes")


n,m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
print(sum/(4.*int(n)))
if int(b[int(m)-1]) < sum/(4.*int(n)):
    print("No")
else:
    print("Yes")


a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) < sum/4:
    print("Yes")
else:
    print("No")


n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) < sum/(4*int(n)):
        yy+=1
if yy <= int(m):
    print("No")
else:
    print("Yes")


n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy >= int(m):
    print("No")
else:
    print("Yes")


a,a1 = input().split()
b = input().split()
sum = 0
for _ in b:
    sum += int(_)
if int(b[int(a1) - 1]) >= sum/(4*a1):
    print("Yes")
else:
    print("No")


n, m = input().split()
b = input().split()
sum = 0
for x in b:
    sum += int(x)
yy=0
for y in b:
    if int(y) >= sum/(4*int(m)):
        yy+=1
if yy < int(m):
    print("No")
else:
    print("Yes")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int, input().split())
A = list(map(int, input().split()))

votes = sum(A)
A.sort()
if A[m-1] < votes/4*m:
  print('No')
else:
  print('Yes')

n,m = map(int, input().split())
A = list(map(int, input().split()))

votes = sum(A)
A.sort(reverse=True)
if A[m-1] < votes/(4*m):
  print('No')
else:
  print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a, reverse=True)

print(new_list[b-1])
if new_list[b-1] > b*4:
    	print("Yes")
else:
    	print("No")


n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a)
 
if new_list[b-1] > b*4:
    	print("Yes")
else:
    	print("No")

n,b= map(int, input().split())
 
a= list(map(int, input().split()))
 
new_list = sorted(a, reverse=True)
sums = sum(a)

if new_list[b-1] >= sums/(b*4):
    	print("Yes")
else:
    	print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int,input().split())
ai=list(map(int,input().split()))
bi=[i for i in ai if i>=sum(ai)/(4*m)]
if len(ai)==len(bi):
    print("Yes")
else:
    print("No")

n,m=map(int,input().split())
ai=list(map(int,input().split()))
bi=[i for i in ai if i>=sum(ai)/(4*m)]
if len(bi)>=m:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
import math

def solve(n,m,lst):
  min_vote = math.ceil(sum(lst)/4/m) - 1
  print(min_vote)
  print(sum(lst))
  return lst[m-1] > min_vote

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  a_list = [int(i) for i in input().split()]
  a_list = sorted(a_list,reverse=True)
  if solve(_n,_m,a_list):
    print('Yes')
  else:
    print('No')


import math

def solve(n,m,lst):
  min_vote = math.ceil(sum(lst)/4/m) - 1
  return lst[m-1] > min_vote

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  a_list = [int(i) for i in input().split()]
  a_list = sorted(a_list,reverse=True)
  if solve(_n,_m,a_list):
    print('Yes')
  else:
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int,input().split())
a = []
a = list(map(int,input().split()))

b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
    if a[i]>=b :
        c += 1

if c>=m :
    print('YES')
else :
    print('NO')

n,m = map(int,input().split())
a = []
a = list(map(int,input().split()))

b = sum(a)/(4.0*m)
c = 0
for i in range(n) :
    if a[i]>=b :
        c += 1

if c>=m :
    print('Yes')
else :
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int,input().split())
a=list(map(int,input().split()))
a_sum=sum(a)
a_sort=sorted(a)
for i in range(m):
  if a_sort[i]<(a_sum)/4/m:
    print("No")
    break
else:
  print("Yes")

n,m = map(int,input().split())
a=list(map(int,input().split()))
a_sum=sum(a)
a_sort=sorted(a,reverse=True)
for i in range(m):
  if a_sort[i]<(a_sum)/4/m:
    print("No")
    break
else:
  print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=[]
a_sort=sorted(a,reverse=True)
sum=0
for i in a:
  sum+=i

for j in range(1,m+1):
 if j<=sum/(4*m):
    print("No")
    exit()
print("Yes")

n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=a.sorted()
sum=0
for i in a:
  sum+=i

for j in (1,m+1):
 if j<=1/(4*m):
    print("No")
    exit()
print("Yes")


n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sort=[]
a_sort=sorted(a,reverse=True)
sum=0
for i in a:
  sum+=i
b_sort=a_sort[0:m]
for j in b_sort:
 if j<sum/(4*m):
    print("No")
    exit()
print("Yes")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M = map(int,input().split())

votos = list(map(int,input().split()))

qtd_votos = sum(votos)
minimo = qtd_votos//(4*M)

contador = 0
for i in votos:
    if i >= minimo:
        contador += 1

print(qtd_votos,contador,minimo)
if contador >= M:
    print("Yes")
else:
    print("No")


N,M = map(int,input().split())

votos = list(map(int,input().split()))

qtd_votos = sum(votos)

minimo = qtd_votos/(4*M)

votos.sort(reverse = True)

if votos[M-1] >= minimo:
    print("Yes")
else:
    print("No")
トすることで判定できます。

N,M = map(int,input().split())

votos = list(map(int,input().split()))

qtd_votos = sum(votos)

minimo = qtd_votos/(4*M)

votos.sort(reverse = True)

if votos[M-1] >= minimo:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal // (4 * trendingItem) + 1
print(votesInt)
print(standard)

clearList = votesInt[votesInt >= standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

import numpy as np

tmp = input().split(" ")
allItem, trendingItem = int(tmp[0]), int(tmp[1])

votes = input().split(" ")
votesInt = np.asarray([int(s) for s in votes])
votesTotal = np.sum(votesInt)

standard = votesTotal / (4 * trendingItem)

clearList = votesInt[votesInt >= standard]

result = 'Yes' if len(clearList) >= trendingItem else 'No'

print(result)

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
import math
n,m=map(int,input().split())

l=list(map(int,input().split()))
s=sum(l)
ans=0
t=s/(4*m)
for i in l:
    if i>=math.ceil(t):
        print(i,math.ceil(t))
        ans+=1
if ans>=m:
    print("Yes")
else:
    print("No")
    


import math
n,m=map(int,input().split())

l=list(map(int,input().split()))
s=sum(l)
ans=0
t=s/(4*m)
for i in l:
    if i>=math.ceil(t):
        ans+=1
if ans>=m:
    print("Yes")
else:
    print("No")
    


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total = sum(A)
print('Yes' if len(1 for a in A if a * 4 * M >= total) >= M else 'No')

N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
total = sum(A)
print('Yes' if len([1 for a in A if a * 4 * M >= total]) >= M else 'No')

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N_s,M_s=input().split()
M=int(M_s)
N=int(N_s)
A=list(map(int,input().split()))


th=sum(A)/(4*M)
#print('th='+ str(th))

A_th=[A_t for A_t in A if A_t>=th]
print('th='+ str(A_th))

if len(A_th)>=M:
    print("Yes")
else:
    print("No")

N_s,M_s=input().split()
M=int(M_s)
N=int(N_s)
A=list(map(int,input().split()))


th=sum(A)/(4*M)
#print('th='+ str(th))

A_th=[A_t for A_t in A if A_t>=th]

if len(A_th)>=M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])

a = input().split(" ")

total = 0
for v in a:
  total += int(a)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes", end="")
else:
  print("No", end="")
 

nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])

a = input().split(" ")

total = 0
for v in a:
  total += int(a)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")
 

= input().split(" ")
n = int(nm[0])
m = int(nm[1])
 
a = input().split(" ")
 
total = 0
for v in a:
  total += int(v)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")
 

nm = input().split(" ")
n = int(nm[0])
m = int(nm[1])
 
a = input().split(" ")
 
total = 0
for v in a:
  total += int(v)
  
mv = total / (4 * m)
q = 0
for e in a:
  e = int(e)
  if e >= mv:
    q += 1
    
if q >= m:
  print("Yes")
else:
  print("No")
 

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):

n,m=map(int,input().split())
a=list(map(int,input().split()))
 
cnt=0
 
for i in a:
	if (s/(4*m))<=i:
		cnt+=1
		if cnt==m:
			print("Yes")
            
if cnt<m:
	print("No")


n,m=map(int,input().split())
a=list(map(int,input().split()))
 
cnt=0
 
for i in a:
	if (sum(a)/(4*m))<=i:
		cnt+=1
		if cnt==m:
			print("Yes")
            
if cnt<m:
	print("No")

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n, m = map(int, input().split())
# n, m = map(int, "4 1".split())
# inputText2 = "5 4 2 1"
inputText2 = input()
input2List = list(map(int,inputText2.split()))
sortList = sorted(input2List, reverse=True)
# print(sortList) #380 19 1000
total = sum(sortList)
# print(total)
h = (1/4*m) * total
# print(h)
flg = False
for i in range(m):
    if sortList[i] < h:
        flg = True


if  flg:
    print("NO")
else:
    print("YES")


n, m = map(int, input().split())
# n, m = map(int, "12 3".split())
# inputText2 = "4 56 78 901 2 345 67 890 123 45 6 789"
inputText2 = input()
input2List = list(map(int,inputText2.split()))
sortList = sorted(input2List, reverse=True)
# print(sortList) #380 19 1000
total = sum(sortList)
# print(total)
h = (1/(4*m)) * total
flg = False
for i in range(m):
    if sortList[i] < h:
        flg = True
        break


if  flg:
    print("No")
else:
    print("Yes")


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M = map(int,input().split())
A = list(map(int,input().split)))
sum = 0
ans = "Yes"
for i in range(len(A)):
  sum += A[i]
judge = sum / (4*M)
for i in ramge(len(A)):
  if A[i] < judge:
    ans = "No"
    break
print(ans)

N,M = map(int,input().split())
A = list(map(int,input().split()))
sumA = sum(A)
count = 0
judge = sumA / (4*M)
for i in range(len(A)):
  if A[i] >= judge:
    count += 1
if count < M:
  ans = "No"
else:
  ans = "Yes"
print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = input().split(" ")
n=int(n)
m=int(m)
arr = list(map(int,input().split(" ")))

x = sum(arr)

frac = x/(m*4)

ans=0
flag=False
for i in range(len(arr)):
    if(arr[i]>=frac):
        ans+=1
    if(ans>=m):
        print("Yes")
        flag=True
        break

if(ans>=m):
    print("Yes")
else:
    print("No")

n,m = input().split(" ")
n=int(n)
m=int(m)
arr = list(map(int,input().split(" ")))

x = sum(arr)

frac = x/(m*4)

ans=0
for i in range(len(arr)):
    if(arr[i]>=frac):
        ans+=1
if(ans>=m):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h==M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h==M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if int(A[i])>=l:
    h+=1
  else:
    h+=0
if h==M:
  print("Yes")
if h<M:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=1/(4*M)
h=0
for i in range(len(A)):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=1/(4*M)
h=0
for i in range(len(A)):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
if M<h
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
if h<M:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=1/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h==M:
  print("Yes")
else:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S//(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h==M:
  print("Yes")
if h<M:
  print("No")

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h>=M:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sorted()
if min(l[m-1]) < 1/(4*m):
  print('No')
else:
  print('Yes')

n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.reverse()
a = sum(l)
for i in range(m):
  if l[i]/a < 1/(4*m):
    print('No')
    exit()
print('Yes')


Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n, M = map(int, input().split())
a = list(map(float, input().split()))
A = sum(a) / (4 * M)
N = sum(x >= A for x in a)
print('Yes' if N >= m else 'No')

n, m = map(int, input().split())
a = list(map(float, input().split()))
A = sum(a) / (4 * M)
N = sum(x >= A for x in a)
print('Yes' if N >= m else 'No')

n, M = map(int, input().split())
a = list(map(int, input().split()))
A = sum(A) / (4 * M)
N = sum(x >= A for x in A)
print('Yes' if n >= M else 'No')

n, m = map(int, input().split())
a = list(map(float, input().split()))
A = sum(a) / (4 * m)
N = sum(x >= A for x in a)
print('Yes' if N >= m else 'No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
 n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

n,m = map(int,input().split())
a = list(map(int, input().split()))
popular = list(filter(lambda e: e>=(1/(4*m))*sum(a),a))
print("Yes" if len(popular) >= m else "No")

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int, input().split())
ar = map(int,input().split())
ans = 0
th = 1/4/m
for i in ar:
  if i < th:
    continue
  ans+=1
print(ans)

n,m = map(int, input().split())
ar = list(map(int,input().split()))
ans = 0
th = sum(ar)/4/m
for i in ar:
  if i < th:
    continue
  ans+=1

if ans >= m:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):

n, m = (int(x) for x in input().split())
a_list = list(map(int, input().split()))

border = sum(a_list) / (4 * m)

print('border')
print(border)

count = 0

for i in range(len(a_list)):

    print('a_list')
    print(a_list[i])

    if border <= a_list[i] :
        print('カウント!')
        count = count + 1

if m <= count :
    print('Yes')
else:
    print('No')


n, m = (int(x) for x in input().split())
a_list = list(map(int, input().split()))

border = sum(a_list) / (4 * m)

# print('border')
# print(border)

count = 0

for i in range(len(a_list)):

    # print('a_list')
    # print(a_list[i])

    if border <= a_list[i] :
        
        count = count + 1

if m <= count :
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(n):
  if i > sum(a) / (4 * m):
    count+=1
if count >= m:
  print("Yes")
else:
  print("No")
  
  

n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
  if a[i] > sum(a) / 4 * m:
    if len(a) <= m:
      print("Yes")
      break;
  else:
    print("No")
    break;
  

n,m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
counter = 0

for i in a:
  if i >= s/(4*m):
    counter = counter + 1

if counter >= m:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))


Change=True
round=1
while Change:
    print("{}週目".format(round))
    Change=False
    for i in range(N-1):
        if A[i+1]>A[i]:
            print("A[{}]({})がA[{}]({})よりも大きいため、交換を行います".format(i+1,A[i+1],i,A[i]))
            temp=A[i+1]
            A[i+1]=A[i]
            A[i]=temp
            Change=True
            print(A)
    round+=1
print("for文終了後のChangeが{}なので、ソートを終了します".format(Change)) 
print(A)
popular=A[0:M]
print("投票数上位{0}個の商品を抽出しました。{0}個の商品の投票数は{1}です。".format(M,popular))
SUM=sum(A)
print("投票数の総和は{}です".format(SUM))

count=True
for j in range(M):
    if SUM*(1/(4*M))>popular[j]:
        print("popular[{0}]({1})は,総投票数の1/8未満({1}<{2})の為、回答はNoとなります".format(j,popular[j],SUM*(1/(4*M))))
        count=False

if(count):
    print("Yes")
else:
    print("No")




            




N,M=map(int,input().split())
A=list(map(int,input().split()))
Change=True
round=1
while Change:
    Change=False
    for i in range(N-1):
        if A[i+1]>A[i]:
            temp=A[i+1]
            A[i+1]=A[i]
            A[i]=temp
            Change=True
    round+=1
popular=A[0:M]
SUM=sum(A)
count=True
for j in range(M):
    if SUM*(1/(4*M))>popular[j]:
        count=False
if(count):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n, m = map(int, input().split())
ai = list(map(int, input().split()))
required = sum(ai) / (4 * m)
print(required)
count = 0
for a in sorted(ai, reverse=True):
    if a >= required:
        count += 1
    else:
        break
print("YNeos"[count < m::2])


b, c = map(int, input().split())
a = list(map(int, input().split()))
d = sum(a)
new_a = list(reversed(sorted(a)))
e = 0
f = 0
g = 4*c
while new_a[e] >= d/g:
    e = e+1
    if e == n:
        break
    f = f+1
if f >= c:
    print("Yes")
else:
    print("No")


n, m = map(int, input().split())
ai = list(map(int, input().split()))
lowest_required = (1 / (4 * m)) * sum(ai)
count = 0
for a in ai:
    if a >= lowest_required:
        count += 1
    else:
        break

print("YNeos"[count >= m::2])


b, c = map(int, input().split())
a = list(map(int, input().split()))
d = sum(a)
new_a = list(reversed(sorted(a)))
e = 0
f = 0
g = 4*c
while new_a[e] >= d/g:
    e = e+1
    f = f+1
    if e == b:
        break
if f >= c:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
def main():
    n, m = map(int, input().split())
    ary = sorted(list(map(int, input().split())), reverse=True)
    print(ary)
    su = sum(ary)
    if ary[m-1] >= su // (4*m):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


def main():
    _, m = map(int, input().split())
    ary = sorted(list(map(int, input().split())), reverse=True)
    if ary[m-1]*4*m >= sum(ary):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N,M = list(map(int,input().split()))
A=list(map(int, input().split())) 

total=sum(A)
for i in range(N):
  if A[i]*4*M>total:
  	cnt=cnt+1

if cnt>=M:
  print('Yes')
else:
  print('No')



N,M = list(map(int,input().split()))
A=list(map(int, input().split())) 
total=sum(A)
cnt=0
for a in A:
  if a*4*M>=total:
  	cnt=cnt+1

print("Yes" if cnt>=M else "No")



Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
count=0
n,m=map(int,input().split())
a=list(map(int,input().split()))

for i in range(n):
    if a[i]<sum(a)//(4*m):
        count=count
    else:
        count+=1
if count==m:
    print("Yes")
else:print("No")
        

count=0
n,m=map(int,input().split())
a=list(map(int,input().split()))
print(sum(a))
for i in range(n):
    if a[i]<sum(a)//(4*m):
        pass
    else:
        count+=1
if count==m:
    print("Yes")
else:print("No")
        

n,m=input().split()
a=list(map(int,input().split()))
count=0
for i in range(int(n)):
    if a[i]<sum(a)//(4*int(m)):
        count=count
    else:
        count+=1
if count==m:
    print("Yes")
else:
    print("No")
        

n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
for i in range(int(n)):
    if a[i]<sum(a)/(4*int(m)):
        count=count
    else:
        count=count+1
if count>=int(m):
    print("Yes")
else:
    print("No")
        

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
A[A >= A.sum()/(4*M)].count() >= M

import numpy as np
N, M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int,input().split())
numList = list(map(int,input().split()))

sum = 0
cnt = 0
for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")
  

n,m = map(int,input().split())
numList = list(map(int,input().split()))

sum = 0
for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    continue
  else:
    print("No")
    exit
    
print("Yes")

n,m = map(int,input().split())
numList = list(map(int,input().split()))

sum = 0
cnt = 0

for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")
  

n,m = map(int,input().split())
numList = list(map(int,input().split()))

sum = 0
cnt = 0

for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    cnt +=1
  else:
    continue
    
if m == cnt:
  print("Yes")
else:
  print("No")
  

n,m = map(int,input().split())
numList = list(map(int,input().split()))

y = 0
n = 0

for i in len(nunList):
  if numList > 1/(4*m):
    y +=1
  else:
    n +=1
    
if y > m:
  print("Yes")
else:
  print("No")
   
  

n,m = map(int,input().split())
Ai = list(map(int,input().split()))

sum = 0
cnt = 0

for i in Ai:
	sum += i

sorted = Ai.sort(reverse=True)

if sorted[m-1] >= sum/(4*m):
  print("Yes")
else:
  print("No")
  


n,m = map(int,input().split())
Ai = list(map(int,input().split()))

sum = 0
cnt = 0

for i in Ai:
	sum += i

for _ in Ai:
  if _ >= sum*(1/(4*m)):
    cnt +=1
  else:
    continue
    
if m == cnt:
  print("Yes")
else:
  print("No")
  

n,m = map(int,input().split())
numList = list(map(int,input().split()))

for i in numList:
	sum += i

for _ in numList:
  if _ > sum/(4*m):
    continue
  else:
    print("No")
    exit
    
print("Yes")

n,m = map(int,input().split())
numList = list(map(int,input().split()))

y = 0
n = 0

for i in len(nunList):
  if  i > 1/(4*m):
    y +=1
  else:
    n +=1
    
if y > m:
  print("Yes")
else:
  print("No")

n,m = map(int,input().split())
numList = list(map(int,input().split()))

for i in numList:
	sum += i

if sum > 1/(4*m):
  print("Yes")
else:
  print("No")


n,m = map(int,input().split())
Ai = list(map(int,input().split()))

sum = 0
cnt = 0

for i in Ai:
	sum += i

for _ in Ai:
  if _ >= sum*(1/(4*m)):
    cnt +=1
  else:
    continue
    
if m >= cnt:
  print("Yes")
else:
  print("No")
  


n,m = map(int,input().split())
Ai = list(map(int,input().split()))

sum = 0

for i in Ai:
	sum += i

S = sorted(Ai,reverse=True)

if S[m-1] >= sum/(4*m):
  print("Yes")
else:
  print("No")
  


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N , M = input().split()
array = input().split()
flag = 0

N = int(N)
M = int(M)

iarray = []

for i in array:
    iarray.append(int(i))

total = sum(iarray)

for i in iarray:
    if i >= total/(4*M):
        flag += 1
if flag >= M:
    print("yes")
else:
    print("no")

N , M = input().split()
array = input().split()
flag = 0

N = int(N)
M = int(M)

iarray = []

for i in array:
    iarray.append(int(i))

total = sum(iarray)

for i in iarray:
    if i >= total/(4*M):
        flag += 1
if flag >= M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m = map(int,input().split())
ar = list(map(int,input().split()))
sum = 0
for i in range(n):
  sum += ar[i]
av = int(sum/(4*m))
ct = 0
for i in range(n):
  if(ar[i] > av):
    ct += 1
  else:
    ct -= 1
if(ct >= m):
  print("Yes")
else:
  print("No")

n,m = map(int,input().split())
ar = list(map(int,input().split()))
s = sum(ar)
av = s/(4*m)
ct = 0
for i in range(n):
  if(ar[i] >= av):
    ct += 1
if(ct >= m):
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
N, M = map(int, input().split())
A = [int(input()) for k in range(N)]

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")

N, M = map(int, input().split())
A = list(map(int, input().split()))

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int, input().split())
a=list(map(int, input().split()))

a.sort(reverse=True)
b=sum(a)/4/m
print(a)
print(a[m])
if a[m-1]<b:
    print('No')
else:
    print('Yes')

n,m=map(int, input().split())
a=list(map(int, input().split()))

a.sort(reverse=True)
b=sum(a)/4/m
if a[m-1]<b:
    print('No')
else:
    print('Yes')

Verdicts: Runtime Error

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
print(s/(4*m))
for i in a:
    if i > s/(4*m):
        cnt += 1
    if cnt == m:
        print('Yes')
        exit()
print('No')

from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
for i in a:
        if i < s//(4*m):
            print('No')
            exit()
print('Yes')

from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, m = inpl()
a = inpl()
s = sum(a)
cnt = 0
for i in a:
    if i*(4*m) >= s:
        cnt += 1
if cnt >= m:
    print('Yes')
else: 
    print('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have held a popularity poll for N items on sale. Item i received A_i votes.  From these N items, we will select M as popular items. However, we cannot select an item with less than \dfrac{1}{4M} of the total number of votes.  If M popular items can be selected, print `Yes`; otherwise, print `No`.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=a[::-1]
print(b)
if b[m-1]<sum(a)/(4*m):
    print("No")
elif True:
    print("Yes")

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=a[::-1]
if b[m-1]<sum(a)/(4*m):
    print("No")
elif True:
    print("Yes")

Verdicts: Wrong Answer

Accepted