题解 | 查找

查找

https://www.nowcoder.com/practice/d93db01c2ee44e8a9237d63842aca8aa

def find(n, s, a, t):

    for i in t:
        tag = 0
        for j in s:
            if j == i:
                print('YES')
                tag = 1
                break
                
        if not tag:
            print('NO')


n = int(input())
s = list(map(int, input().split()))
a = int(input())
t = list(map(int, input().split()))
find(n, s, a, t)

全部评论

相关推荐

09-26 19:45
门头沟学院 Java
点赞 评论 收藏
分享
10-16 19:16
Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务