#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <math.h>
#include <unordered_map>
#include <vector>
using namespace std;
 
int N, M;
unordered_map<intint> check;
 
int main(void)
{
//    freopen("B10816_input.txt", "r", stdin);
    
    ios_base :: sync_with_stdio(false); 
    cin.tie(NULL); 
    cout.tie(NULL);
 
    cin >> N;
    
    for(int i = 1; i <= N; i++)
    {
        int num;
        cin >> num;
        
        check[num] += 1;
    }
    
    cin >> M;
    
    while(M--)
    {
        int Find;
        cin >> Find;
    
        cout << check[Find] << " ";
    }
 
    return 0;
}
cs

+ Recent posts