結果

問題 No.2334 Distinct Cards
ユーザー GrayCoderGrayCoder
提出日時 2023-06-02 22:08:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 26,732 KB
最終ジャッジ日時 2023-08-28 03:40:58
合計ジャッジ時間 2,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,524 KB
testcase_01 AC 18 ms
8,460 KB
testcase_02 AC 18 ms
8,516 KB
testcase_03 AC 18 ms
8,624 KB
testcase_04 AC 18 ms
8,636 KB
testcase_05 AC 18 ms
8,600 KB
testcase_06 AC 18 ms
8,488 KB
testcase_07 AC 19 ms
8,684 KB
testcase_08 AC 18 ms
8,568 KB
testcase_09 AC 19 ms
8,708 KB
testcase_10 AC 19 ms
8,568 KB
testcase_11 AC 19 ms
8,752 KB
testcase_12 AC 77 ms
21,568 KB
testcase_13 AC 78 ms
21,296 KB
testcase_14 AC 84 ms
21,644 KB
testcase_15 AC 80 ms
21,516 KB
testcase_16 AC 80 ms
21,288 KB
testcase_17 AC 82 ms
26,732 KB
testcase_18 AC 85 ms
26,692 KB
testcase_19 AC 89 ms
26,580 KB
testcase_20 AC 55 ms
16,036 KB
testcase_21 AC 54 ms
16,156 KB
testcase_22 AC 54 ms
16,048 KB
testcase_23 AC 19 ms
8,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys


def main():
    sys.setrecursionlimit(1000000)
    input = lambda: sys.stdin.readline()[:-1]
    N, K = map(int, input().split())
    A = map(int, input().split())

    cnt = Counter(A).most_common()
    ans = 0
    for _, n in cnt:
        ans += 1
        K -= n
        if K <= 0:
            break
    print(ans)


if not __debug__:
    f = open(sys.argv[1], "r")
    sys.stdin = f

main()
0