結果

問題 No.2334 Distinct Cards
ユーザー 👑 tatyamtatyam
提出日時 2023-06-02 21:24:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 1,497 ms
コンパイル使用メモリ 86,668 KB
実行使用メモリ 100,588 KB
最終ジャッジ日時 2023-08-28 02:39:14
合計ジャッジ時間 4,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,428 KB
testcase_01 AC 89 ms
71,596 KB
testcase_02 AC 91 ms
71,508 KB
testcase_03 AC 93 ms
71,480 KB
testcase_04 AC 92 ms
71,312 KB
testcase_05 AC 91 ms
71,780 KB
testcase_06 AC 91 ms
71,512 KB
testcase_07 AC 91 ms
71,664 KB
testcase_08 AC 93 ms
71,408 KB
testcase_09 AC 95 ms
71,504 KB
testcase_10 AC 94 ms
71,536 KB
testcase_11 AC 92 ms
71,360 KB
testcase_12 AC 149 ms
94,768 KB
testcase_13 AC 150 ms
94,856 KB
testcase_14 AC 152 ms
94,848 KB
testcase_15 AC 158 ms
95,076 KB
testcase_16 AC 152 ms
94,904 KB
testcase_17 AC 138 ms
100,452 KB
testcase_18 AC 139 ms
100,308 KB
testcase_19 AC 139 ms
100,588 KB
testcase_20 AC 112 ms
84,792 KB
testcase_21 AC 110 ms
84,756 KB
testcase_22 AC 115 ms
85,028 KB
testcase_23 AC 93 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

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