結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,716 KB
testcase_01 AC 96 ms
71,444 KB
testcase_02 AC 98 ms
71,652 KB
testcase_03 AC 95 ms
71,720 KB
testcase_04 AC 100 ms
71,532 KB
testcase_05 AC 94 ms
71,556 KB
testcase_06 AC 95 ms
71,808 KB
testcase_07 AC 95 ms
71,564 KB
testcase_08 AC 95 ms
71,776 KB
testcase_09 AC 99 ms
71,564 KB
testcase_10 AC 97 ms
71,688 KB
testcase_11 AC 99 ms
71,720 KB
testcase_12 AC 153 ms
103,976 KB
testcase_13 AC 147 ms
104,328 KB
testcase_14 AC 149 ms
104,124 KB
testcase_15 AC 149 ms
104,096 KB
testcase_16 AC 153 ms
104,132 KB
testcase_17 AC 147 ms
111,972 KB
testcase_18 AC 147 ms
112,164 KB
testcase_19 AC 145 ms
112,116 KB
testcase_20 AC 117 ms
91,148 KB
testcase_21 AC 116 ms
91,216 KB
testcase_22 AC 121 ms
91,468 KB
testcase_23 AC 92 ms
71,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder391A

'''
やばい回に紛れ込んでしまった 助かるかな
'''
f=lambda:list(map(int,input().split()))
from collections import defaultdict as dd
N,K=f(); A=f(); D=dd(int)
for i in A: D[i]+=1
num=[]
for i in D: num.append(D[i])
num.sort(reverse=True)
ans=0; cnt=0
for i in num:
    ans+=1; cnt+=i
    if cnt>=K: print(ans); break
0