結果

問題 No.2334 Distinct Cards
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-06-02 21:41:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 1,095 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 107,228 KB
最終ジャッジ日時 2023-08-28 03:00:34
合計ジャッジ時間 5,037 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,684 KB
testcase_01 AC 95 ms
71,640 KB
testcase_02 AC 95 ms
71,608 KB
testcase_03 AC 94 ms
71,524 KB
testcase_04 AC 95 ms
71,336 KB
testcase_05 AC 94 ms
71,456 KB
testcase_06 AC 95 ms
71,540 KB
testcase_07 AC 95 ms
71,460 KB
testcase_08 AC 95 ms
71,524 KB
testcase_09 AC 96 ms
71,680 KB
testcase_10 AC 97 ms
71,652 KB
testcase_11 AC 97 ms
71,396 KB
testcase_12 AC 153 ms
101,124 KB
testcase_13 AC 152 ms
101,392 KB
testcase_14 AC 144 ms
101,340 KB
testcase_15 AC 144 ms
101,632 KB
testcase_16 AC 145 ms
101,724 KB
testcase_17 AC 140 ms
106,972 KB
testcase_18 AC 141 ms
107,208 KB
testcase_19 AC 140 ms
107,228 KB
testcase_20 AC 121 ms
91,152 KB
testcase_21 AC 118 ms
90,992 KB
testcase_22 AC 120 ms
90,996 KB
testcase_23 AC 92 ms
71,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n,k = map(int,input().split())

C = Counter(list(map(int,input().split())))

values = list(C.values())
values.sort()

ans = 0
for v in values[::-1]:
	k -= v
	ans += 1
	if k <= 0:
		print(ans)
		exit()
0