結果
| 問題 | 
                            No.8016 unordered_mapなるたけ落とすマン
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-03-04 13:54:12 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 139 ms / 1,000 ms | 
| コード長 | 454 bytes | 
| コンパイル時間 | 726 ms | 
| コンパイル使用メモリ | 82,580 KB | 
| 実行使用メモリ | 10,112 KB | 
| 最終ジャッジ日時 | 2024-07-07 14:49:41 | 
| 合計ジャッジ時間 | 9,893 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 48 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main(){
    int N, M;
    cin >> N >> M;
    map<long, int> array_A;
    for(int i = 0; i < N; i++){
        long num;
        cin >> num;
        array_A[num]++;
    }
    string ans;
    for(int i = 0; i < M; i++){
        long num;
        cin >> num;
        ans += to_string(array_A[num]) + " ";
    }
    ans.pop_back();
    cout << ans << endl;
}