結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー hgoto
提出日時 2020-09-26 13:52:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 455 bytes
コンパイル時間 2,626 ms
コンパイル使用メモリ 199,648 KB
最終ジャッジ日時 2025-01-14 22:17:21
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  unordered_map<long long, int> mp;
  while (n--) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  while (m--) {
    long long b;
    cin >> b;
    if (mp.count(b)) {
      cout << mp[b];
    } else {
      cout << 0;
    }
    if (m == 0) {
      cout << '\n';
    } else {
      cout << ' ';
    }
  }
  return 0;
}
0