結果

問題 No.2334 Distinct Cards
ユーザー KudeKude
提出日時 2023-06-02 21:22:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 95,788 KB
最終ジャッジ日時 2023-08-28 02:35:13
合計ジャッジ時間 4,310 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,240 KB
testcase_01 AC 73 ms
71,208 KB
testcase_02 AC 74 ms
71,256 KB
testcase_03 AC 75 ms
71,256 KB
testcase_04 AC 73 ms
71,148 KB
testcase_05 AC 73 ms
71,412 KB
testcase_06 AC 74 ms
71,352 KB
testcase_07 AC 85 ms
75,216 KB
testcase_08 AC 83 ms
75,172 KB
testcase_09 AC 73 ms
71,404 KB
testcase_10 AC 76 ms
71,260 KB
testcase_11 AC 79 ms
75,460 KB
testcase_12 AC 136 ms
90,776 KB
testcase_13 AC 134 ms
90,956 KB
testcase_14 AC 134 ms
90,912 KB
testcase_15 AC 132 ms
90,896 KB
testcase_16 AC 131 ms
90,608 KB
testcase_17 AC 129 ms
90,900 KB
testcase_18 AC 130 ms
90,864 KB
testcase_19 AC 133 ms
90,692 KB
testcase_20 AC 101 ms
95,672 KB
testcase_21 AC 98 ms
95,788 KB
testcase_22 AC 98 ms
95,480 KB
testcase_23 AC 73 ms
71,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import groupby
n, k = map(int, input().split())
a = sorted(map(int, input().split()))
ans = 0
for x in sorted(len(list(it)) for x, it in groupby(a))[::-1]:
    ans += 1
    k -= x
    if k <= 0:
        break
print(ans)
0