結果

問題 No.2777 Wild Flush
ユーザー kaede2020kaede2020
提出日時 2024-06-07 22:15:58
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 6,590 ms
コンパイル使用メモリ 336,376 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-06-07 22:16:06
合計ジャッジ時間 6,918 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 15 ms
5,376 KB
testcase_10 AC 14 ms
5,376 KB
testcase_11 AC 15 ms
5,376 KB
testcase_12 AC 46 ms
8,448 KB
testcase_13 AC 51 ms
6,784 KB
testcase_14 AC 52 ms
6,624 KB
testcase_15 AC 52 ms
6,528 KB
testcase_16 AC 5 ms
5,376 KB
testcase_17 AC 49 ms
6,528 KB
testcase_18 AC 33 ms
5,724 KB
testcase_19 AC 32 ms
5,724 KB
testcase_20 AC 12 ms
5,376 KB
testcase_21 AC 8 ms
5,376 KB
testcase_22 AC 30 ms
5,444 KB
testcase_23 AC 29 ms
5,760 KB
testcase_24 AC 36 ms
5,736 KB
testcase_25 AC 59 ms
6,848 KB
testcase_26 AC 46 ms
6,412 KB
testcase_27 AC 23 ms
5,376 KB
testcase_28 AC 7 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using mint = modint998244353;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};

int n,k;
int main(){
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    map<int,int> mp;
    rep(i,n){
        mp[a[i]]++;
    }
    int kaeru_ok=mp[0];
    int dai=0;
    for(auto x:mp){
        if(x.first==0) continue;
        dai=max(dai,x.second);
    }
    if(dai+kaeru_ok>=k){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}
0