結果

問題 No.3197 Frequency Counter
ユーザー 北杜
提出日時 2025-07-11 21:37:58
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 756 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 3,172 ms
コンパイル使用メモリ 283,104 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2025-07-11 21:38:30
合計ジャッジ時間 9,388 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
using ll = long long;
const int INF32 = 2e9;
const ll INF64 = 4e18;

void printYN(bool ok){
    if(ok)cout << "Yes" << endl;
    else cout << "No" << endl;
    return;
}

int main() {
    int N;
    cin >> N;
    map<int, int> ma;
    rep(i, N){
        int ai;
        cin >> ai;
        if(ma.count(ai))ma[ai]++;
        else ma[ai] = 1;
    }
    int Q;
    cin >> Q;
    rep(i, Q){
        int x, k;
        cin >> x >> k;
        printYN(ma.count(x)&&ma[x]>=k);
    }
    return 0;
}
0