結果
| 問題 |
No.2777 Wild Flush
|
| コンテスト | |
| ユーザー |
ManjushriMitra
|
| 提出日時 | 2024-08-14 23:43:31 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 946 bytes |
| コンパイル時間 | 3,419 ms |
| コンパイル使用メモリ | 252,964 KB |
| 実行使用メモリ | 8,320 KB |
| 最終ジャッジ日時 | 2024-08-14 23:43:37 |
| 合計ジャッジ時間 | 5,330 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 24 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repll(i,m,n) for(ll i=m; i<n; ++i)
// #define rep(i,m,n) for(ll i=m; i<n; ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define fir first
#define sec second
template<typename T> bool chmin(T& a, T b){
if(a > b){a = b; return true;}
return false;
}
template<typename T> bool chmax(T& a, T b){
if(a < b){a = b; return true;}
return false;
}
int main(){
int N, K;
cin >> N >> K;
vector<int> A(N);
rep(i, 0, N) cin >> A[i];
map<int, int> mp;
rep(i, 0, N) mp[A[i]]++;
if(mp[0] >= K){
puts("Yes");
return 0;
}
int max_num = -1;
for(auto m : mp){
if(m.fir == 0) continue;
chmax(max_num, m.sec);
}
if(max_num + mp[0] >= K){
puts("Yes");
}else{
puts("No");
}
return 0;
}
ManjushriMitra