题解 | #谁是你的潜在朋友#

谁是你的潜在朋友

https://www.nowcoder.com/practice/0177394fb25b42b48657bc2b1c6f9fcc

m, n = list(map(int, input().split(" ")))#示例真坑,多了个空格
book = []
ans = [0 for i in range(m)]
for i in range(m):
    book.append(int(input()))
for j in range(m):
    for k in range(m):
        if book[j] == book[k] and j != k:
            ans[j] += 1
for x in ans:
    if x != 0:
        print(x)
    else:
        print("BeiJu")

全部评论

相关推荐

10-10 17:54
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务