結果
問題 | No.2777 Wild Flush |
ユーザー |
|
提出日時 | 2024-06-08 17:40:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 2,115 ms |
コンパイル使用メモリ | 167,984 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-28 06:30:16 |
合計ジャッジ時間 | 3,901 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i=0; i<(int)n; i++) int main() { int N, K; cin >> N >> K; vector<int> A(N); vector<int> mark(N+1, 0); rep(i, N) { int Ai; cin >> Ai; mark[Ai]++; } bool ans = false; rep(i, N+1) { if (i == 0) { if (mark[i] >= K) ans = true; } else { if (mark[i] + mark[0] >= K) ans = true; } } if (ans) cout << "Yes" << endl; else cout << "No" << endl; return 0; }