結果
| 問題 |
No.2334 Distinct Cards
|
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2023-06-02 21:22:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 112 ms / 2,000 ms |
| コード長 | 259 bytes |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 82,196 KB |
| 実行使用メモリ | 110,072 KB |
| 最終ジャッジ日時 | 2024-12-28 16:06:32 |
| 合計ジャッジ時間 | 2,684 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))
c = Counter(a)
x = sorted(c.items(), key=lambda x:-x[1])
t = 0
ans = 0
for a, b in x:
ans += 1
t += b
if t >= k:
print(ans)
break
hir355