結果

問題 No.2334 Distinct Cards
ユーザー 2000 Ekiben2000 Ekiben
提出日時 2023-06-03 15:31:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,012 KB
実行使用メモリ 83,180 KB
最終ジャッジ日時 2024-06-09 03:37:42
合計ジャッジ時間 1,927 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,204 KB
testcase_01 AC 30 ms
52,604 KB
testcase_02 AC 30 ms
52,612 KB
testcase_03 AC 30 ms
52,336 KB
testcase_04 AC 29 ms
53,164 KB
testcase_05 AC 30 ms
53,804 KB
testcase_06 AC 28 ms
53,220 KB
testcase_07 AC 30 ms
53,216 KB
testcase_08 AC 31 ms
53,976 KB
testcase_09 AC 30 ms
52,620 KB
testcase_10 AC 30 ms
52,796 KB
testcase_11 AC 30 ms
53,844 KB
testcase_12 AC 60 ms
82,488 KB
testcase_13 AC 60 ms
82,596 KB
testcase_14 AC 60 ms
82,736 KB
testcase_15 AC 59 ms
83,156 KB
testcase_16 AC 59 ms
83,180 KB
testcase_17 AC 51 ms
80,488 KB
testcase_18 AC 52 ms
81,628 KB
testcase_19 AC 52 ms
81,184 KB
testcase_20 AC 51 ms
80,644 KB
testcase_21 AC 51 ms
81,292 KB
testcase_22 AC 51 ms
80,676 KB
testcase_23 AC 30 ms
52,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
c=list(map(int, input().split()))
co = [0]*(N + 1)
for i in range(N):
    co[c[i]]+=1
co.sort(reverse=True)
t=0
n=0
for co in co:
    if t>=K:
        break
    t += co
    n+=1
print(n)
0