結果
| 問題 |
No.2334 Distinct Cards
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-02 22:08:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 2,000 ms |
| コード長 | 438 bytes |
| コンパイル時間 | 393 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 27,356 KB |
| 最終ジャッジ日時 | 2024-12-28 18:17:10 |
| 合計ジャッジ時間 | 2,745 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
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()