結果
問題 | No.2334 Distinct Cards |
ユーザー | H20 |
提出日時 | 2023-06-02 21:47:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 118 ms / 2,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 722 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 107,008 KB |
最終ジャッジ日時 | 2024-12-28 17:12:25 |
合計ジャッジ時間 | 3,302 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
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()