結果

問題 No.2334 Distinct Cards
ユーザー anastaanasta
提出日時 2023-06-16 20:43:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 25,196 KB
最終ジャッジ日時 2023-09-06 17:57:07
合計ジャッジ時間 3,226 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,520 KB
testcase_01 AC 16 ms
8,612 KB
testcase_02 AC 17 ms
8,544 KB
testcase_03 AC 17 ms
8,652 KB
testcase_04 AC 17 ms
8,644 KB
testcase_05 AC 17 ms
8,520 KB
testcase_06 AC 16 ms
8,556 KB
testcase_07 AC 17 ms
8,668 KB
testcase_08 AC 17 ms
8,780 KB
testcase_09 AC 17 ms
8,712 KB
testcase_10 AC 18 ms
8,732 KB
testcase_11 AC 17 ms
8,604 KB
testcase_12 AC 78 ms
19,884 KB
testcase_13 AC 79 ms
19,996 KB
testcase_14 AC 91 ms
19,852 KB
testcase_15 AC 80 ms
19,944 KB
testcase_16 AC 78 ms
19,852 KB
testcase_17 AC 80 ms
25,016 KB
testcase_18 AC 93 ms
24,964 KB
testcase_19 AC 105 ms
25,196 KB
testcase_20 AC 61 ms
20,044 KB
testcase_21 AC 61 ms
19,972 KB
testcase_22 AC 60 ms
20,072 KB
testcase_23 AC 17 ms
8,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

N,K=map(lambda x: int(x), input().split())

ct = 0
tmp = 0

for p in collections.Counter(list(map(lambda x: int(x), input().split()))).most_common():
	
	ct+=1
	tmp += p[1]

	if tmp >= K:
		break

print(ct)
0