結果
| 問題 |
No.3016 ハチマキおじさん
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 16:56:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 666 bytes |
| コンパイル時間 | 2,830 ms |
| コンパイル使用メモリ | 86,856 KB |
| 実行使用メモリ | 11,544 KB |
| 最終ジャッジ日時 | 2025-06-12 16:56:37 |
| 合計ジャッジ時間 | 5,947 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 31 |
ソースコード
#include <unordered_map>
#include <vector>
#include <iostream>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<long long> A(N);
for (int i = 0; i < N; ++i) {
std::cin >> A[i];
}
std::unordered_map<long long, int> counts;
for (long long a : A) {
counts[a]++;
}
std::vector<long long> B(M);
for (int i = 0; i < M; ++i) {
std::cin >> B[i];
}
for (long long b : B) {
auto it = counts.find(b);
if (it != counts.end()) {
std::cout << it->second << " ";
} else {
std::cout << 0 << " ";
}
}
std::cout << std::endl;
return 0;
}
gew1fw