結果

問題 No.2334 Distinct Cards
ユーザー 👑 H20H20
提出日時 2023-06-02 21:47:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 112,016 KB
最終ジャッジ日時 2023-08-28 03:08:08
合計ジャッジ時間 4,204 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,480 KB
testcase_01 AC 90 ms
71,636 KB
testcase_02 AC 87 ms
71,664 KB
testcase_03 AC 88 ms
71,240 KB
testcase_04 AC 93 ms
71,748 KB
testcase_05 AC 92 ms
71,436 KB
testcase_06 AC 90 ms
71,548 KB
testcase_07 AC 91 ms
71,672 KB
testcase_08 AC 93 ms
71,372 KB
testcase_09 AC 91 ms
71,380 KB
testcase_10 AC 91 ms
71,616 KB
testcase_11 AC 90 ms
71,708 KB
testcase_12 AC 142 ms
103,804 KB
testcase_13 AC 142 ms
104,224 KB
testcase_14 AC 144 ms
104,004 KB
testcase_15 AC 143 ms
104,056 KB
testcase_16 AC 141 ms
104,084 KB
testcase_17 AC 138 ms
111,908 KB
testcase_18 AC 137 ms
112,016 KB
testcase_19 AC 139 ms
111,940 KB
testcase_20 AC 115 ms
90,876 KB
testcase_21 AC 115 ms
91,232 KB
testcase_22 AC 115 ms
91,076 KB
testcase_23 AC 91 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,K = map(int, input().split())
A = list(map(int, input().split())) 
CA = collections.Counter(A)
L = []
for v in CA.values():
    L.append(v)
L.sort(reverse=True)
ans = 0
for i,l in enumerate(L):
    K-=l    
    if K<=0:
        print(i+1)
        exit()
0