班级排队

n=int(input())
list1=list(map(eval,input().split()))
list2=list(map(eval,input().split()))
list3_b=[]
list3_g=[]
for i in range(n):
    if list2[i]==1:
        list3_g.append(list1[i])
    else:
        list3_b.append(list1[i])
list3_b.sort()
list3_g.sort()
for i in list3_g:
    print(i,end=" ")
for i in range(len(list3_b)-1):
    print(list3_b[i], end=" ")
print(list3_b[-1])

 

posted @ 2020-06-21 16:40  tf383838  阅读(143)  评论(0编辑  收藏  举报