結果
| 問題 |
No.2334 Distinct Cards
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-04 23:07:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 257 bytes |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 24,548 KB |
| 最終ジャッジ日時 | 2024-07-26 14:54:41 |
| 合計ジャッジ時間 | 2,756 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
from collections import Counter
n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
c = sorted(Counter(a).values())[::-1]
ans = 1
for cc in c:
k -= cc
if k <= 0:
print(ans)
break
else:
ans += 1