不要用列表list内置函数count,不然最后一个测试点会超时
if __name__ == '__main__':
n = int(input())
l = input().split()
inputs = input().split()
m = {}
res = []
for i in range(len(l)):
if l[i] not in m.keys():
m[l[i]] = 1
else:
m[l[i]] += 1
for i in range(1, int(inputs[0]) + 1):
if str(inputs[i]) in m.keys():
res.append(str(m[inputs[i]]))
else:
res.append("0")
print(" ".join(res))