結果

問題 No.2334 Distinct Cards
ユーザー Akijin_007Akijin_007
提出日時 2023-06-02 21:29:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 95,036 KB
最終ジャッジ日時 2023-08-28 02:45:52
合計ジャッジ時間 3,916 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,608 KB
testcase_01 AC 87 ms
71,688 KB
testcase_02 AC 89 ms
71,272 KB
testcase_03 AC 92 ms
71,492 KB
testcase_04 AC 88 ms
71,544 KB
testcase_05 AC 89 ms
71,808 KB
testcase_06 AC 89 ms
71,676 KB
testcase_07 AC 91 ms
71,444 KB
testcase_08 AC 88 ms
71,488 KB
testcase_09 AC 93 ms
71,700 KB
testcase_10 AC 90 ms
71,492 KB
testcase_11 AC 91 ms
71,644 KB
testcase_12 AC 133 ms
90,784 KB
testcase_13 AC 135 ms
90,588 KB
testcase_14 AC 135 ms
90,476 KB
testcase_15 AC 134 ms
90,532 KB
testcase_16 AC 135 ms
90,456 KB
testcase_17 AC 129 ms
94,744 KB
testcase_18 AC 129 ms
94,960 KB
testcase_19 AC 130 ms
95,036 KB
testcase_20 AC 115 ms
90,572 KB
testcase_21 AC 119 ms
90,608 KB
testcase_22 AC 116 ms
90,584 KB
testcase_23 AC 91 ms
71,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))

from collections import Counter

c = Counter(A)

v = sorted(c.values(), reverse=True)

ans = 0
s = 0
for i in range(len(v)):
    ans += 1
    s += v[i]
    if s >= K:
        break
print(ans)
0