結果

問題 No.2334 Distinct Cards
ユーザー titiatitia
提出日時 2023-06-02 22:32:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 23,628 KB
最終ジャッジ日時 2023-08-28 04:32:55
合計ジャッジ時間 2,431 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,452 KB
testcase_01 AC 19 ms
8,468 KB
testcase_02 AC 19 ms
8,584 KB
testcase_03 AC 18 ms
8,448 KB
testcase_04 AC 18 ms
8,508 KB
testcase_05 AC 18 ms
8,552 KB
testcase_06 AC 18 ms
8,556 KB
testcase_07 AC 18 ms
8,548 KB
testcase_08 AC 18 ms
8,696 KB
testcase_09 AC 19 ms
8,552 KB
testcase_10 AC 18 ms
8,576 KB
testcase_11 AC 18 ms
8,564 KB
testcase_12 AC 67 ms
19,928 KB
testcase_13 AC 70 ms
19,852 KB
testcase_14 AC 80 ms
19,848 KB
testcase_15 AC 70 ms
19,888 KB
testcase_16 AC 68 ms
19,860 KB
testcase_17 AC 60 ms
23,576 KB
testcase_18 AC 74 ms
23,484 KB
testcase_19 AC 82 ms
23,628 KB
testcase_20 AC 56 ms
20,024 KB
testcase_21 AC 56 ms
20,040 KB
testcase_22 AC 57 ms
20,020 KB
testcase_23 AC 18 ms
8,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

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

C=Counter(A)

B=list(C.values())
B.sort(reverse=True)

now=0

for i in range(len(B)):
    now+=B[i]

    if now>=K:
        print(i+1)
        break
0