답안 #527082

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
527082 2022-02-17T01:16:52 Z Honeybee Labels (NOI20_labels) Python 3
0 / 100
246 ms 20692 KB
N = int(input())
user2 = input().split()
lst = []
output = [1]
low = 1
neg = False
valid = True

for i in user2:
    lst.append(int(i))
    if int(i) < 0:
        neg = True
        low = min(low, int(i))

if N == 2:
    if user2[0] == 0:
        print(-1)
    elif user2[0] == 1:
        print('1 2')
    else:
        print('2, 1')
        
if neg == False:
    for i in range(len(lst)):
        output.append(lst[i] + output[i])
        if output[-1] > N:
            valid = False

if valid == False:
    print('-1')
else:
    for i in output:
        print(i)
        pritn(' ')
# 결과 실행 시간 메모리 Grader output
1 Runtime error 13 ms 2868 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 13 ms 2868 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 13 ms 2868 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 246 ms 20692 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 13 ms 2868 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -