結果

問題 No.2334 Distinct Cards
ユーザー hir355hir355
提出日時 2023-06-02 21:21:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 106,740 KB
最終ジャッジ日時 2023-08-28 02:33:03
合計ジャッジ時間 4,480 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,484 KB
testcase_01 AC 88 ms
71,600 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 137 ms
106,712 KB
testcase_18 AC 140 ms
106,740 KB
testcase_19 AC 137 ms
106,588 KB
testcase_20 AC 113 ms
90,928 KB
testcase_21 AC 112 ms
90,988 KB
testcase_22 AC 113 ms
90,984 KB
testcase_23 AC 89 ms
71,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
    
0