結果

問題 No.2334 Distinct Cards
ユーザー pluto77pluto77
提出日時 2023-06-20 14:20:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 23,580 KB
最終ジャッジ日時 2023-09-10 09:55:16
合計ジャッジ時間 3,104 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,540 KB
testcase_01 AC 18 ms
8,664 KB
testcase_02 AC 18 ms
8,624 KB
testcase_03 AC 18 ms
8,680 KB
testcase_04 AC 18 ms
8,528 KB
testcase_05 AC 18 ms
8,576 KB
testcase_06 AC 18 ms
8,532 KB
testcase_07 AC 18 ms
8,616 KB
testcase_08 AC 19 ms
8,668 KB
testcase_09 AC 19 ms
8,612 KB
testcase_10 AC 18 ms
8,668 KB
testcase_11 AC 18 ms
8,708 KB
testcase_12 AC 71 ms
20,040 KB
testcase_13 AC 68 ms
19,860 KB
testcase_14 AC 78 ms
20,032 KB
testcase_15 AC 70 ms
20,000 KB
testcase_16 AC 67 ms
19,892 KB
testcase_17 AC 62 ms
23,500 KB
testcase_18 AC 73 ms
23,568 KB
testcase_19 AC 83 ms
23,580 KB
testcase_20 AC 57 ms
20,084 KB
testcase_21 AC 58 ms
20,144 KB
testcase_22 AC 58 ms
20,212 KB
testcase_23 AC 19 ms
8,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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