結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,712 KB
testcase_01 AC 100 ms
71,644 KB
testcase_02 AC 97 ms
71,612 KB
testcase_03 AC 94 ms
71,656 KB
testcase_04 AC 94 ms
71,612 KB
testcase_05 AC 93 ms
71,528 KB
testcase_06 AC 93 ms
71,716 KB
testcase_07 AC 99 ms
71,528 KB
testcase_08 AC 93 ms
71,712 KB
testcase_09 AC 93 ms
71,584 KB
testcase_10 AC 95 ms
71,584 KB
testcase_11 AC 93 ms
71,356 KB
testcase_12 AC 177 ms
100,532 KB
testcase_13 AC 145 ms
100,964 KB
testcase_14 AC 142 ms
101,108 KB
testcase_15 AC 142 ms
100,876 KB
testcase_16 AC 145 ms
101,220 KB
testcase_17 AC 137 ms
106,332 KB
testcase_18 AC 137 ms
106,516 KB
testcase_19 AC 138 ms
106,640 KB
testcase_20 AC 119 ms
90,892 KB
testcase_21 AC 119 ms
90,960 KB
testcase_22 AC 120 ms
90,912 KB
testcase_23 AC 96 ms
71,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))
c = Counter(a)
ls = list(c.values())
ls.sort(reverse = True)
s = 0
for i in range(len(ls)):
  s += ls[i]
  if s >= k:
    print(i + 1)
    exit()
0