結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー zeosutt
提出日時 2016-05-20 14:11:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 276 ms / 1,000 ms
コード長 402 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 69,044 KB
実行使用メモリ 9,268 KB
最終ジャッジ日時 2024-10-07 05:10:27
合計ジャッジ時間 13,899 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <unordered_map>

using namespace std;

struct MyHash {
	size_t operator()(long long val) const {
		return val * 10000000000000000ULL;
	}
};

int main() {
	int n, m;
	unordered_map<long long, int, MyHash> cnt;

	cin >> n >> m;
	while (n--) {
		long long a;
		cin >> a;
		cnt[a]++;
	}
	while (m--) {
		long long b;
		cin >> b;
		cout << cnt[b] << " \n"[!m];
	}

	return 0;
}
0