結果
問題 | No.2334 Distinct Cards |
ユーザー |
![]() |
提出日時 | 2023-06-02 21:25:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 143 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 108,288 KB |
最終ジャッジ日時 | 2024-12-28 16:21:08 |
合計ジャッジ時間 | 3,591 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
N, K = map(int, input().split())A = list(map(int, input().split()))from collections import Countercounted = Counter(A)counted = list(counted.items())counted.sort(key = lambda x:x[1], reverse = True)card_count = 0num_count = 0for num, c in counted:num_count += 1card_count += cif card_count >= K:breakprint(num_count)