結果
問題 |
No.3016 ハチマキおじさん
|
ユーザー |
![]() |
提出日時 | 2025-06-12 21:35:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 666 bytes |
コンパイル時間 | 2,516 ms |
コンパイル使用メモリ | 86,656 KB |
実行使用メモリ | 11,548 KB |
最終ジャッジ日時 | 2025-06-12 21:37:37 |
合計ジャッジ時間 | 8,997 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }