Source Code
l1=list(map(int,input().split()))
l=list(map(int,input().split()))
p=list(map(int,input().split()))
n=l1[0]
m=l1[1]
d={}
for i in range(n):
    d[l[i]]=i
d1={}
for i in range(m):
    d1[p[i]]=i
l.sort()
p.sort(reverse=True)
c=""
for i in d1.keys():
    b=p.index(i)
    g=d[l[b]]+1
    c+=str(g)
    c+=" "
print(c)
Copy
Probability Game housssem1999
Python 3
51 ms
5.9 MB
Wrong Answer