結果

問題 No.2334 Distinct Cards
ユーザー 👑 tatyam
提出日時 2023-06-02 21:24:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 82,828 KB
実行使用メモリ 104,960 KB
最終ジャッジ日時 2024-12-28 16:13:33
合計ジャッジ時間 2,767 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N, K = map(int, input().split())
A = Counter(map(int, input().split()))
ans = 0
for num, cnt in A.most_common():
    ans += 1
    K -= cnt
    if K <= 0:
        break
print(ans)

0