__cat__QWQ @ 2024-02-02 09:38:29
a = input().split(" ")
n = int(a[0])
m = int(a[1])
dic = list(map(int, input().split(" ")))
find = list(map(int, input().split(" ")))
ans = []
for k in find:
i = 0
j = n
while i < j:
m = (i + j) // 2
if dic[m] < k:
i = m + 1
else:
j = m
if dic[i] == k:
ans.append(str(i + 1))
else:
ans.append("-1")
print(" ".join(ans))
by gghvcchb @ 2024-03-06 09:36:05
@catQWQ 兄弟,找到原因了吗