L1-020 帅到没朋友 python

python 实现

参考:https://blog.csdn.net/m0_74101869/article/details/131479677

num1=int(input())
friends=set()
for i in range(num1):
    s=input().split()
    if s[0]!="1":
        friends.update(s)

num2=int(input())
s2=input().split()
result=[]
for item in s2:
    if item not in friends and item not in result:
        result.append(item)

if len(result)==0:
    print("No one is handsome")
else:
    print(*result)

 

posted @ 2024-07-06 19:07  豆豆是只乖狗狗  阅读(2)  评论(0编辑  收藏  举报