結果

問題 No.2334 Distinct Cards
ユーザー koarakko5555koarakko5555
提出日時 2023-06-02 22:31:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 106,612 KB
最終ジャッジ日時 2023-08-28 04:31:09
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,544 KB
testcase_01 AC 88 ms
71,504 KB
testcase_02 AC 89 ms
71,844 KB
testcase_03 AC 87 ms
71,504 KB
testcase_04 AC 90 ms
71,580 KB
testcase_05 AC 86 ms
71,828 KB
testcase_06 AC 87 ms
71,560 KB
testcase_07 AC 87 ms
71,852 KB
testcase_08 AC 89 ms
71,828 KB
testcase_09 AC 88 ms
71,608 KB
testcase_10 AC 86 ms
71,564 KB
testcase_11 AC 88 ms
71,480 KB
testcase_12 AC 133 ms
100,864 KB
testcase_13 AC 135 ms
101,060 KB
testcase_14 AC 137 ms
101,056 KB
testcase_15 AC 138 ms
101,048 KB
testcase_16 AC 140 ms
101,160 KB
testcase_17 AC 132 ms
106,384 KB
testcase_18 AC 133 ms
106,612 KB
testcase_19 AC 133 ms
106,476 KB
testcase_20 AC 112 ms
91,004 KB
testcase_21 AC 112 ms
91,040 KB
testcase_22 AC 113 ms
91,136 KB
testcase_23 AC 84 ms
71,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

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

ans = 0
num = 0

Acv = list(Ac.values())
Acv.sort(reverse=True)
for c in Acv:
    #print(v, c)
    num += c
    ans += 1
    if K <= num:
        print(ans)
        exit()
0