結果
| 問題 | No.2334 Distinct Cards |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-02 21:42:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 1,980 ms |
| コンパイル使用メモリ | 172,616 KB |
| 実行使用メモリ | 8,064 KB |
| 最終ジャッジ日時 | 2024-12-28 16:59:43 |
| 合計ジャッジ時間 | 2,977 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
int i,j,k;
int N,K;
cin >> N >> K;
map<int,int> m;
for(i=1;i<=N;i++){
int a;
cin >> a;
a*=-1;
m[a]++;
}
int ans=0,s=0;
for(auto x : m){
ans++;
s+=x.second;
if(s>=K) break;
}
cout << ans << endl;
return 0;
}