QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#705742 | #7933. Build Permutation | ohiostatescarlet# | WA | 12ms | 10624kb | Python3 | 328b | 2024-11-03 01:15:40 | 2024-11-03 01:15:40 |
Judging History
answer
n = int(input())
a = list(map(int, input().split()))
b = [[a[i], i] for i in range(n)]
b.sort()
out = [1 for _ in range(n)]
index = n
for x1, x2 in zip(b, b[1:]):
if x1[0] + 1 != x2[0]:
print(-1)
exit()
out[x1[1]] = index
out[x2[1]] = index - 1
index -= 1
print(*out)
詳細信息
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 10624kb
input:
5 4 2 5 1 3
output:
2 4 1 5 3
result:
wrong answer