結果

問題 No.2777 Wild Flush
コンテスト
ユーザー Theta
提出日時 2024-07-10 17:26:11
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 576 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 158 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 99,200 KB
最終ジャッジ日時 2026-03-30 09:31:32
合計ジャッジ時間 2,272 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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