結果
| 問題 | No.8016 unordered_mapなるたけ落とすマン |
| ユーザー |
|
| 提出日時 | 2016-05-22 00:57:55 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 43 ms / 1,000 ms |
| + 183µs | |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 902 ms |
| コンパイル使用メモリ | 180,540 KB |
| 実行使用メモリ | 9,796 KB |
| 最終ジャッジ日時 | 2026-09-11 10:47:26 |
| 合計ジャッジ時間 | 8,271 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 48 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
size_t r;
struct Hash {
size_t operator()(const long long &x) const {
return hash<long long>()(x) ^ r;
}
};
int main() {
int n, m;
cin >> n >> m;
srand(time(NULL));
r = (rand() << 16) + rand();
unordered_map<long long, int, Hash> mp;
for (int i = 0; i < n; i++) {
long long a;
scanf("%lld", &a);
mp[a]++;
}
for (int i = 0; i < m; i++) {
long long b;
scanf("%lld", &b);
printf("%d ", mp[b]);
}
cout << endl;
}