⌨️

[AtCoder]ABC-161|B - Popular Vote

2023/03/09に公開

設問ページ

提出結果

def getIntMap():
    return map(int, input().split())


def getIntList():
    return list(map(int, input().split()))


def main():
    n, m = getIntMap()
    a = getIntList()

    c = 0
    l = sum(a) / (4 * m)

    for x in a:
        if x >= l:
            c += 1
            if c == m:
                break

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


if __name__ == "__main__":
    main()

Discussion