結果

問題 No.3016 ハチマキおじさん
ユーザー gew1fw
提出日時 2025-06-12 12:56:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 13,336 KB
最終ジャッジ日時 2025-06-12 13:02:10
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;

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

    int N, M;
    cin >> N >> M;

    unordered_map<long long, int> count;
    for (int i = 0; i < N; ++i) {
        long long a;
        cin >> a;
        ++count[a];
    }

    vector<int> res(M);
    for (int i = 0; i < M; ++i) {
        long long b;
        cin >> b;
        res[i] = count[b];
    }

    for (int i = 0; i < M; ++i) {
        if (i > 0) cout << ' ';
        cout << res[i];
    }
    cout << '\n';

    return 0;
}
0