結果

問題 No.2334 Distinct Cards
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-02 21:22:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 104,876 KB
最終ジャッジ日時 2023-08-28 02:36:37
合計ジャッジ時間 3,747 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,484 KB
testcase_01 AC 73 ms
71,480 KB
testcase_02 AC 73 ms
70,988 KB
testcase_03 AC 73 ms
71,340 KB
testcase_04 AC 72 ms
71,248 KB
testcase_05 AC 72 ms
71,320 KB
testcase_06 AC 75 ms
71,308 KB
testcase_07 AC 73 ms
71,164 KB
testcase_08 AC 76 ms
71,352 KB
testcase_09 AC 73 ms
71,252 KB
testcase_10 AC 73 ms
71,164 KB
testcase_11 AC 73 ms
71,280 KB
testcase_12 AC 121 ms
99,200 KB
testcase_13 AC 123 ms
99,224 KB
testcase_14 AC 124 ms
99,400 KB
testcase_15 AC 122 ms
99,156 KB
testcase_16 AC 124 ms
99,364 KB
testcase_17 AC 119 ms
104,852 KB
testcase_18 AC 119 ms
104,876 KB
testcase_19 AC 120 ms
104,688 KB
testcase_20 AC 96 ms
89,508 KB
testcase_21 AC 95 ms
89,404 KB
testcase_22 AC 95 ms
89,564 KB
testcase_23 AC 72 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin

N,K = map(int,stdin.readline().split())

A = list(map(int,stdin.readline().split()))

dic = {}

for i in A:
    if i not in dic:
        dic[i] = 0
    dic[i] += 1

B = [dic[i] for i in dic]

B.sort()
B.reverse()

s = 0
for i in range(len(B)):

    s += B[i]
    if s >= K:
        print (i+1)
        break
0