题解 | 机器翻译

机器翻译

https://www.nowcoder.com/practice/45ecfecd83104f37a685016361be504c

m, n = map(int, input().strip().split())
w, t, c = list(map(int, input().strip().split())), [], 0
for i in w:
    if i in t:
        continue
    else:
        if len(t) >= m:
            t.pop(0)
        c += 1
        t.append(i)
print(c)

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

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