結果
| 問題 | No.2334 Distinct Cards |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2023-06-02 21:21:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 262 bytes |
| 記録 | |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 109,568 KB |
| 最終ジャッジ日時 | 2024-12-28 16:00:35 |
| 合計ジャッジ時間 | 3,408 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 WA * 15 |
ソースコード
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