結果
問題 | No.2334 Distinct Cards |
ユーザー |
|
提出日時 | 2023-06-02 21:32:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 161 ms / 2,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 619 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 112,256 KB |
最終ジャッジ日時 | 2024-12-28 16:37:23 |
合計ジャッジ時間 | 3,302 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
n,k=map(int,input().split())l=list(map(int,input().split()))from collections import defaultdictd=defaultdict(int)for i in range(n):d[l[i]]+=1ans=[]for key,val in d.items():ans.append((key,val))ans.sort(key=lambda x: -x[1])cnt=0while k>0:k-= ans[cnt][1]cnt+=1else:print(cnt)