結果

問題 No.2334 Distinct Cards
ユーザー 遭難者遭難者
提出日時 2023-06-02 22:17:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 1,032 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 107,600 KB
最終ジャッジ日時 2023-08-28 04:00:27
合計ジャッジ時間 4,675 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,508 KB
testcase_01 AC 88 ms
71,604 KB
testcase_02 AC 85 ms
71,752 KB
testcase_03 AC 86 ms
71,488 KB
testcase_04 AC 87 ms
71,832 KB
testcase_05 AC 87 ms
71,484 KB
testcase_06 AC 94 ms
71,464 KB
testcase_07 AC 86 ms
71,528 KB
testcase_08 AC 89 ms
71,488 KB
testcase_09 AC 88 ms
71,876 KB
testcase_10 AC 87 ms
71,812 KB
testcase_11 AC 87 ms
71,612 KB
testcase_12 AC 134 ms
101,556 KB
testcase_13 AC 135 ms
101,648 KB
testcase_14 AC 137 ms
101,676 KB
testcase_15 AC 135 ms
101,584 KB
testcase_16 AC 137 ms
101,512 KB
testcase_17 AC 134 ms
107,468 KB
testcase_18 AC 132 ms
107,600 KB
testcase_19 AC 132 ms
107,496 KB
testcase_20 AC 110 ms
91,428 KB
testcase_21 AC 110 ms
91,204 KB
testcase_22 AC 110 ms
91,444 KB
testcase_23 AC 86 ms
71,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

a = defaultdict(int)
n, k = map(int, input().split())
for i in list(map(int, input().split())):
    a[i] += 1
b = sorted(list(a.values()))
m = len(b)
ans = 0
while k > 0:
    ans += 1
    k -= b[m - ans]
print(ans)
0