結果
| 問題 | 
                            No.8016 unordered_mapなるたけ落とすマン
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-03-04 13:55:15 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 474 bytes | 
| コンパイル時間 | 803 ms | 
| コンパイル使用メモリ | 84,912 KB | 
| 実行使用メモリ | 14,016 KB | 
| 最終ジャッジ日時 | 2024-07-07 14:50:43 | 
| 合計ジャッジ時間 | 5,804 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 TLE * 1 -- * 35 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_map>
using namespace std;
int main(){
    int N, M;
    cin >> N >> M;
    unordered_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;
}