結果

問題 No.2777 Wild Flush
ユーザー Theta
提出日時 2024-07-10 17:26:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 82,660 KB
実行使用メモリ 98,560 KB
最終ジャッジ日時 2024-07-10 17:26:15
合計ジャッジ時間 4,088 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def main():
    N, K = map(int, input().split())
    A = []
    zero_ctr = 0
    for elm in map(int, input().split()):
        if elm == 0:
            zero_ctr += 1
        else:
            A.append(elm)
    ctr_A = Counter(A)
    if ctr_A:
        max_n = max(ctr_A.values())
    else:
        max_n = 0
    if max_n >= K:
        print("Yes")
        return
    if zero_ctr >= K:
        print("Yes")
        return
    if max_n + zero_ctr >= K:
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()
0