結果

問題 No.3197 Frequency Counter
ユーザー ゼリトキ
提出日時 2025-07-11 21:33:09
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 392 ms / 2,000 ms
コード長 681 bytes
コンパイル時間 3,358 ms
コンパイル使用メモリ 283,344 KB
実行使用メモリ 20,736 KB
最終ジャッジ日時 2025-07-11 21:33:16
合計ジャッジ時間 6,467 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
const long long mod=998244353;
const long long hmod=46216567629137;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    int N;
    cin>>N;
    ll A[N+1];
    map<ll,ll>dat;
    for(int i=1;i<=N;i++){
        cin>>A[i];
        if(dat.count(A[i])>=1) dat[A[i]]++;
        else dat[A[i]]=1;
    }
    int Q;
    cin>>Q;
    ll x[Q+1],k[Q+1];
    for(int i=1;i<=Q;i++){
        cin>>x[i]>>k[i];
        if(dat.count(x[i])>=1){
            if(dat[x[i]]>=k[i]) cout<<"Yes\n";
            else cout<<"No\n";
        }
        else cout<<"No\n";
    }
}
0