結果

問題 No.3197 Frequency Counter
ユーザー YY-otter
提出日時 2025-06-27 11:41:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 1,305 ms
コンパイル使用メモリ 100,332 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2025-07-10 14:46:44
合計ジャッジ時間 5,554 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    int N;
    std::cin >> N;
    std::map<int, int> counts;
    for (int i = 0; i < N; ++i) {
        int a;
        std::cin >> a;
        counts[a]++;
    }

    int Q;
    std::cin >> Q;
    for (int i = 0; i < Q; ++i) {
        int x, k;
        std::cin >> x >> k;
        if (counts.count(x) && counts[x] >= k) {
            std::cout << "Yes\n";
        } else {
            std::cout << "No\n";
        }
    }
    return 0;
}
0