結果
| 問題 | No.2334 Distinct Cards |
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2021-09-30 23:25:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 424 bytes |
| コンパイル時間 | 1,959 ms |
| コンパイル使用メモリ | 171,424 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-28 15:54:20 |
| 合計ジャッジ時間 | 2,857 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 4 WA * 18 |
ソースコード
//WA
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, K;
cin >> N >> K;
vector<int> A(N);
for (int i = 0; i < N; i++){
cin >> A[i];
A[i]--;
}
vector<int> cnt(N, 0);
for (int i = 0; i < N; i++){
cnt[A[i]]++;
}
sort(cnt.begin(), cnt.end());
int ans = 0;
for (int i = 0; i < N; i++){
K -= cnt[i];
ans++;
if (K <= 0){
break;
}
}
cout << ans << endl;
}
SSRS