結果

問題 No.2334 Distinct Cards
ユーザー 310icecrystal310icecrystal
提出日時 2023-06-03 03:49:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 95,312 KB
最終ジャッジ日時 2023-08-28 07:36:11
合計ジャッジ時間 4,510 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,792 KB
testcase_01 AC 88 ms
71,728 KB
testcase_02 AC 90 ms
71,656 KB
testcase_03 AC 87 ms
71,624 KB
testcase_04 AC 86 ms
71,752 KB
testcase_05 AC 87 ms
71,724 KB
testcase_06 AC 87 ms
71,804 KB
testcase_07 AC 87 ms
71,620 KB
testcase_08 AC 87 ms
71,780 KB
testcase_09 AC 88 ms
71,748 KB
testcase_10 AC 87 ms
71,488 KB
testcase_11 AC 90 ms
71,412 KB
testcase_12 AC 146 ms
90,484 KB
testcase_13 AC 149 ms
90,484 KB
testcase_14 AC 152 ms
90,632 KB
testcase_15 AC 148 ms
90,584 KB
testcase_16 AC 151 ms
90,600 KB
testcase_17 AC 136 ms
95,312 KB
testcase_18 AC 136 ms
95,092 KB
testcase_19 AC 137 ms
95,064 KB
testcase_20 AC 115 ms
90,516 KB
testcase_21 AC 114 ms
90,544 KB
testcase_22 AC 114 ms
90,632 KB
testcase_23 AC 88 ms
71,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

from collections import Counter
A_count = Counter(A)

A_count_sorted = sorted(A_count.items(),key = lambda x:x[1],reverse=True)
i = 0
while K >= 1:
    K -= A_count_sorted[i][1]
    i += 1

print(i)
0