結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー zimpha
提出日時 2017-12-14 22:12:08
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 485 ms
コンパイル使用メモリ 69,248 KB
実行使用メモリ 14,752 KB
最終ジャッジ日時 2026-06-06 20:06:09
合計ジャッジ時間 5,596 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 TLE * 1 -- * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <unordered_map>

using int64 = long long;

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  std::unordered_map<int64, int> cnt;
  for (int i = 0; i < n; ++i) {
    int64 x;
    scanf("%lld", &x);
    ++cnt[x];
  }
  for (int i = 0; i < m; ++i) {
    if (i) putchar(' ');
    int64 x;
    scanf("%lld", &x);
    auto it = cnt.find(x);
    if (it == cnt.end()) putchar('0');
    else printf("%d", it->second);
  }
  puts("");
  return 0;
}
0