QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#683798#7933. Build PermutationvdayskyWA 11ms10736kbPython3309b2024-10-27 23:55:072024-10-27 23:55:12

Judging History

你现在查看的是最新测评结果

  • [2024-10-27 23:55:12]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10736kb
  • [2024-10-27 23:55:07]
  • 提交

answer

input()
nums = list(map(int, input().split()))

sorted_nums = sorted(nums)
if sorted_nums != list(range(1, len(sorted_nums) + 1)):
    print(-1)
else:
    target_sum = sorted_nums[-1] + 1
    for x in nums:
        print(target_sum - x, end=" ")
    print()

if __name__ == '__main__':
    pass

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 11ms
memory: 10736kb

input:

5
4 2 5 1 3

output:

2 4 1 5 3 

result:

wrong answer