結果

問題 No.2334 Distinct Cards
ユーザー ニックネームニックネーム
提出日時 2023-06-02 21:21:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 26,912 KB
最終ジャッジ日時 2023-08-28 02:34:23
合計ジャッジ時間 2,641 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,592 KB
testcase_01 AC 18 ms
8,488 KB
testcase_02 AC 18 ms
8,428 KB
testcase_03 AC 18 ms
8,396 KB
testcase_04 AC 18 ms
8,420 KB
testcase_05 AC 18 ms
8,432 KB
testcase_06 AC 18 ms
8,520 KB
testcase_07 AC 19 ms
8,544 KB
testcase_08 AC 19 ms
8,688 KB
testcase_09 AC 18 ms
8,624 KB
testcase_10 AC 18 ms
8,668 KB
testcase_11 AC 17 ms
8,628 KB
testcase_12 AC 68 ms
21,600 KB
testcase_13 AC 69 ms
21,544 KB
testcase_14 AC 83 ms
21,480 KB
testcase_15 AC 71 ms
21,516 KB
testcase_16 AC 69 ms
21,488 KB
testcase_17 AC 64 ms
26,548 KB
testcase_18 AC 75 ms
26,912 KB
testcase_19 AC 88 ms
26,708 KB
testcase_20 AC 54 ms
16,064 KB
testcase_21 AC 54 ms
15,988 KB
testcase_22 AC 53 ms
16,132 KB
testcase_23 AC 18 ms
8,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n,k = map(int,input().split())
a = Counter(map(int,input().split()))
ans = 0
for v in sorted(a.values())[::-1]:
    ans += 1; k -= v
    if k<=0: break
print(ans)
0