import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] stu=new int[n];
int i,j,k;
for (i=0;i<n;i++){
stu[i]=sc.nextInt();
}
int num=sc.nextInt();
int[] score=new int[num];
int[] count=new int[num];
for (j=0;j<num;j++){
score[j]=sc.nextInt();
count[j]=0;
}
//以上为数据初始化,接下来判断个数
for (j=0;j<num;j++){
for (i=0;i<n;i++){
if (score[j]==stu[i]){
count[j]++;
}
}
}
for (j=0;j<num;j++){
if (j==num-1){
System.out.print(count[j]);
}else
System.out.print(count[j]+" ");
}
}
}
一个超时,无法解决