結果

問題 No.2334 Distinct Cards
ユーザー ShirotsumeShirotsume
提出日時 2023-06-02 21:21:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 106,884 KB
最終ジャッジ日時 2023-08-28 02:33:08
合計ジャッジ時間 4,535 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
74,728 KB
testcase_01 AC 109 ms
74,588 KB
testcase_02 AC 111 ms
74,872 KB
testcase_03 AC 111 ms
74,924 KB
testcase_04 AC 109 ms
74,508 KB
testcase_05 AC 108 ms
74,736 KB
testcase_06 AC 110 ms
74,864 KB
testcase_07 AC 109 ms
74,772 KB
testcase_08 AC 108 ms
74,472 KB
testcase_09 AC 110 ms
74,312 KB
testcase_10 AC 111 ms
74,732 KB
testcase_11 AC 111 ms
74,472 KB
testcase_12 AC 153 ms
99,720 KB
testcase_13 AC 155 ms
99,284 KB
testcase_14 AC 155 ms
94,872 KB
testcase_15 AC 157 ms
99,520 KB
testcase_16 AC 157 ms
98,808 KB
testcase_17 AC 155 ms
106,816 KB
testcase_18 AC 155 ms
106,848 KB
testcase_19 AC 155 ms
106,884 KB
testcase_20 AC 132 ms
93,064 KB
testcase_21 AC 133 ms
93,500 KB
testcase_22 AC 133 ms
93,200 KB
testcase_23 AC 110 ms
74,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n, k = mi()

a = list(Counter(li()).values())

ans = 0

a.sort(reverse=True)

for v in a:
    ans += 1
    k -= v
    if k <= 0:
        break
print(ans)
0