各位大佬,帮看看探险这题代码哪儿有问题吗,挺简单一题咋A不了呢 n = int(input()) keys = [int(x) for x in input().split(' ')] res = [''] * n lock = 1 for day in range(1, n+1): while lock in keys[:day]: res[lock - 1] = str(day) lock += 1 print(' '.join(res))
点赞 2
牛客网
牛客企业服务