結果

問題 No.2334 Distinct Cards
ユーザー komkompikomkompi
提出日時 2023-06-10 23:59:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 19,800 KB
最終ジャッジ日時 2023-08-31 01:34:22
合計ジャッジ時間 4,280 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,856 KB
testcase_01 AC 13 ms
7,784 KB
testcase_02 AC 12 ms
7,856 KB
testcase_03 AC 12 ms
7,836 KB
testcase_04 AC 12 ms
7,828 KB
testcase_05 AC 13 ms
7,936 KB
testcase_06 AC 13 ms
7,984 KB
testcase_07 AC 13 ms
7,828 KB
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 13 ms
7,872 KB
testcase_10 AC 13 ms
7,972 KB
testcase_11 AC 13 ms
7,824 KB
testcase_12 AC 58 ms
19,668 KB
testcase_13 AC 59 ms
19,636 KB
testcase_14 AC 70 ms
19,756 KB
testcase_15 AC 61 ms
19,656 KB
testcase_16 AC 57 ms
19,732 KB
testcase_17 AC 52 ms
19,632 KB
testcase_18 AC 60 ms
19,668 KB
testcase_19 AC 71 ms
19,684 KB
testcase_20 AC 54 ms
19,728 KB
testcase_21 AC 53 ms
19,800 KB
testcase_22 AC 51 ms
19,612 KB
testcase_23 AC 13 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

N,K=map(int,input().split())
A=list(map(int,input().split()))

log=[0]*N

for a in A:
    log[a-1]+=1

log.sort(reverse=True)

specie=0
for l in log:
    K-=l
    specie+=1
    if K<=0:
        break

print(specie)
0