统计同成绩学生
n = int(input())
lst = list(map(int,input().split()))
grades = list(map(int,input().split()))
lst.sort()
result = []
for i in range(1,grades[0]+1):
if grades[i] not in lst :
result.append(0)
else:
count = 0
l = lst.index(grades[i])
for j in range(l,len(lst)):
if lst[j] == grades[i]:
count += 1
else:
break
result.append(count)
print(' '.join(map(str,result)))
最后一个测试点超时