Problem p02718 (python)

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

total_votes = sum(A)

total_votes_checker = lambda M, i, total_votes: (False if i < (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

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

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes_checker = lambda M, i, total_votes: (False if i <= (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

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

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes <= 1 / (4 * M) 
                                        else True)

total_votes = sum(A)
A_iter = iter(A)

acceptable_A = list(filter(lambda A_item: total_votes_checker(A_item, total_votes), A))
    
print(acceptable_A)


# acceptable_A = list(filter(total_votes_checker(next(A_iter),total_votes), A))

#item_num_checker = lambda N, A: True if len(A) == N else False

print(max(A),A[M])
popular_checker = lambda A, M: True if A[M] == max(A) else False

print(popular_checker(acceptable_A,M))

TF = popular_checker(acceptable_A,M)

printer = lambda TF : print("Yes") if TF else print("No")

printer(TF)

Buggy submission (verdict: Runtime Error):
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)
A_iter = iter(A)

is_acceptable = filter(total_votes_checker(next(A_iter)), total_votes)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("Yes") if True else print("No")

printer(TF)

Buggy submission (verdict: Runtime Error):
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("yes") if True else print("No")

printer(TF)

Buggy submission (verdict: Runtime Error):
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("yes") if True else print("No")

printer(TF)

Buggy submission (verdict: Runtime Error):
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF = print("yes") if True else print("No")

printer(TF)