結果

問題 No.2777 Wild Flush
ユーザー elphe
提出日時 2024-06-27 15:29:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 71,904 KB
最終ジャッジ日時 2025-02-22 00:46:44
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N, K, i;
    cin >> N >> K;
    vector<int> A(N), count(100001, 0);
    for (i = 0; i != N; ++i)
        cin >> A[i];

    for (i = 0; i != N; ++i)
        ++count[A[i]];

    for (i = 1; i <= 100000; ++i)
        if (count[i] + count[0] >= K)
        {
            cout << "Yes\n";
            return 0;
        }

    cout << "No\n";
    return 0;
}
0