import sys
N = int(input())
P = [0] * N
D = [int(x) for x in input().split(" ")]
D.append(0)
for x in range(N - 1):
if x:
D[x] += D[x - 1]
if max(D) - min(D) != N - 1:
print("-1")
sys.exit()
P[0] = N - max(D)
for x in range(1, N):
P[x] = P[0] + D[x - 1]
print(" ".join(str(_) for _ in P))
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
3308 KB |
Output is correct |
2 |
Correct |
23 ms |
3308 KB |
Output is correct |
3 |
Correct |
27 ms |
3300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
3308 KB |
Output is correct |
2 |
Correct |
23 ms |
3308 KB |
Output is correct |
3 |
Correct |
27 ms |
3300 KB |
Output is correct |
4 |
Correct |
26 ms |
3348 KB |
Output is correct |
5 |
Correct |
25 ms |
3308 KB |
Output is correct |
6 |
Correct |
20 ms |
3308 KB |
Output is correct |
7 |
Correct |
30 ms |
3300 KB |
Output is correct |
8 |
Correct |
23 ms |
3300 KB |
Output is correct |
9 |
Correct |
31 ms |
3300 KB |
Output is correct |
10 |
Correct |
21 ms |
3300 KB |
Output is correct |
11 |
Correct |
30 ms |
3300 KB |
Output is correct |
12 |
Correct |
32 ms |
3300 KB |
Output is correct |
13 |
Correct |
22 ms |
3336 KB |
Output is correct |
14 |
Correct |
31 ms |
3308 KB |
Output is correct |
15 |
Correct |
20 ms |
3308 KB |
Output is correct |
16 |
Correct |
34 ms |
3308 KB |
Output is correct |
17 |
Correct |
21 ms |
3300 KB |
Output is correct |
18 |
Correct |
21 ms |
3308 KB |
Output is correct |
19 |
Correct |
24 ms |
3308 KB |
Output is correct |
20 |
Correct |
24 ms |
3344 KB |
Output is correct |
21 |
Correct |
24 ms |
3308 KB |
Output is correct |
22 |
Correct |
20 ms |
3352 KB |
Output is correct |
23 |
Correct |
23 ms |
3308 KB |
Output is correct |
24 |
Correct |
22 ms |
3300 KB |
Output is correct |
25 |
Correct |
22 ms |
3308 KB |
Output is correct |
26 |
Correct |
21 ms |
3308 KB |
Output is correct |
27 |
Correct |
19 ms |
3308 KB |
Output is correct |
28 |
Correct |
21 ms |
3308 KB |
Output is correct |
29 |
Correct |
23 ms |
3308 KB |
Output is correct |
30 |
Correct |
21 ms |
3308 KB |
Output is correct |
31 |
Correct |
21 ms |
3280 KB |
Output is correct |
32 |
Correct |
23 ms |
3300 KB |
Output is correct |
33 |
Correct |
32 ms |
3300 KB |
Output is correct |
34 |
Correct |
21 ms |
3308 KB |
Output is correct |
35 |
Correct |
21 ms |
3300 KB |
Output is correct |
36 |
Correct |
26 ms |
3300 KB |
Output is correct |
37 |
Correct |
20 ms |
3300 KB |
Output is correct |
38 |
Correct |
21 ms |
3308 KB |
Output is correct |
39 |
Correct |
27 ms |
3308 KB |
Output is correct |
40 |
Correct |
21 ms |
3308 KB |
Output is correct |
41 |
Correct |
22 ms |
3300 KB |
Output is correct |
42 |
Correct |
30 ms |
3300 KB |
Output is correct |
43 |
Correct |
22 ms |
3308 KB |
Output is correct |
44 |
Correct |
21 ms |
3308 KB |
Output is correct |
45 |
Correct |
23 ms |
3308 KB |
Output is correct |
46 |
Correct |
23 ms |
3344 KB |
Output is correct |
47 |
Correct |
22 ms |
3300 KB |
Output is correct |
48 |
Correct |
33 ms |
3300 KB |
Output is correct |
49 |
Correct |
22 ms |
3284 KB |
Output is correct |
50 |
Correct |
31 ms |
3300 KB |
Output is correct |
51 |
Correct |
22 ms |
3328 KB |
Output is correct |
52 |
Correct |
22 ms |
3292 KB |
Output is correct |
53 |
Correct |
21 ms |
3308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
3308 KB |
Output is correct |
2 |
Correct |
23 ms |
3308 KB |
Output is correct |
3 |
Correct |
27 ms |
3300 KB |
Output is correct |
4 |
Correct |
26 ms |
3348 KB |
Output is correct |
5 |
Correct |
25 ms |
3308 KB |
Output is correct |
6 |
Correct |
20 ms |
3308 KB |
Output is correct |
7 |
Correct |
30 ms |
3300 KB |
Output is correct |
8 |
Correct |
23 ms |
3300 KB |
Output is correct |
9 |
Correct |
31 ms |
3300 KB |
Output is correct |
10 |
Correct |
21 ms |
3300 KB |
Output is correct |
11 |
Correct |
30 ms |
3300 KB |
Output is correct |
12 |
Correct |
32 ms |
3300 KB |
Output is correct |
13 |
Correct |
22 ms |
3336 KB |
Output is correct |
14 |
Correct |
31 ms |
3308 KB |
Output is correct |
15 |
Correct |
20 ms |
3308 KB |
Output is correct |
16 |
Correct |
34 ms |
3308 KB |
Output is correct |
17 |
Correct |
21 ms |
3300 KB |
Output is correct |
18 |
Correct |
21 ms |
3308 KB |
Output is correct |
19 |
Correct |
24 ms |
3308 KB |
Output is correct |
20 |
Correct |
24 ms |
3344 KB |
Output is correct |
21 |
Correct |
24 ms |
3308 KB |
Output is correct |
22 |
Correct |
20 ms |
3352 KB |
Output is correct |
23 |
Correct |
23 ms |
3308 KB |
Output is correct |
24 |
Correct |
22 ms |
3300 KB |
Output is correct |
25 |
Correct |
22 ms |
3308 KB |
Output is correct |
26 |
Correct |
21 ms |
3308 KB |
Output is correct |
27 |
Correct |
19 ms |
3308 KB |
Output is correct |
28 |
Correct |
21 ms |
3308 KB |
Output is correct |
29 |
Correct |
23 ms |
3308 KB |
Output is correct |
30 |
Correct |
21 ms |
3308 KB |
Output is correct |
31 |
Correct |
21 ms |
3280 KB |
Output is correct |
32 |
Correct |
23 ms |
3300 KB |
Output is correct |
33 |
Correct |
32 ms |
3300 KB |
Output is correct |
34 |
Correct |
21 ms |
3308 KB |
Output is correct |
35 |
Correct |
21 ms |
3300 KB |
Output is correct |
36 |
Correct |
26 ms |
3300 KB |
Output is correct |
37 |
Correct |
20 ms |
3300 KB |
Output is correct |
38 |
Correct |
21 ms |
3308 KB |
Output is correct |
39 |
Correct |
27 ms |
3308 KB |
Output is correct |
40 |
Correct |
21 ms |
3308 KB |
Output is correct |
41 |
Correct |
22 ms |
3300 KB |
Output is correct |
42 |
Correct |
30 ms |
3300 KB |
Output is correct |
43 |
Correct |
22 ms |
3308 KB |
Output is correct |
44 |
Correct |
21 ms |
3308 KB |
Output is correct |
45 |
Correct |
23 ms |
3308 KB |
Output is correct |
46 |
Correct |
23 ms |
3344 KB |
Output is correct |
47 |
Correct |
22 ms |
3300 KB |
Output is correct |
48 |
Correct |
33 ms |
3300 KB |
Output is correct |
49 |
Correct |
22 ms |
3284 KB |
Output is correct |
50 |
Correct |
31 ms |
3300 KB |
Output is correct |
51 |
Correct |
22 ms |
3328 KB |
Output is correct |
52 |
Correct |
22 ms |
3292 KB |
Output is correct |
53 |
Correct |
21 ms |
3308 KB |
Output is correct |
54 |
Correct |
25 ms |
3380 KB |
Output is correct |
55 |
Correct |
24 ms |
3380 KB |
Output is correct |
56 |
Correct |
24 ms |
3508 KB |
Output is correct |
57 |
Correct |
23 ms |
3372 KB |
Output is correct |
58 |
Correct |
21 ms |
3380 KB |
Output is correct |
59 |
Correct |
22 ms |
3380 KB |
Output is correct |
60 |
Correct |
22 ms |
3380 KB |
Output is correct |
61 |
Correct |
27 ms |
3372 KB |
Output is correct |
62 |
Correct |
22 ms |
3380 KB |
Output is correct |
63 |
Correct |
23 ms |
3380 KB |
Output is correct |
64 |
Correct |
30 ms |
3380 KB |
Output is correct |
65 |
Correct |
22 ms |
3372 KB |
Output is correct |
66 |
Correct |
22 ms |
3508 KB |
Output is correct |
67 |
Correct |
21 ms |
3380 KB |
Output is correct |
68 |
Correct |
25 ms |
3380 KB |
Output is correct |
69 |
Correct |
23 ms |
3380 KB |
Output is correct |
70 |
Correct |
30 ms |
3372 KB |
Output is correct |
71 |
Correct |
22 ms |
3380 KB |
Output is correct |
72 |
Correct |
20 ms |
3372 KB |
Output is correct |
73 |
Correct |
30 ms |
3372 KB |
Output is correct |
74 |
Correct |
24 ms |
3380 KB |
Output is correct |
75 |
Correct |
23 ms |
3380 KB |
Output is correct |
76 |
Correct |
22 ms |
3380 KB |
Output is correct |
77 |
Correct |
22 ms |
3372 KB |
Output is correct |
78 |
Correct |
22 ms |
3380 KB |
Output is correct |
79 |
Correct |
22 ms |
3372 KB |
Output is correct |
80 |
Correct |
21 ms |
3380 KB |
Output is correct |
81 |
Correct |
23 ms |
3380 KB |
Output is correct |
82 |
Correct |
21 ms |
3372 KB |
Output is correct |
83 |
Correct |
22 ms |
3380 KB |
Output is correct |
84 |
Correct |
21 ms |
3380 KB |
Output is correct |
85 |
Correct |
21 ms |
3376 KB |
Output is correct |
86 |
Correct |
24 ms |
3440 KB |
Output is correct |
87 |
Correct |
21 ms |
3380 KB |
Output is correct |
88 |
Correct |
22 ms |
3372 KB |
Output is correct |
89 |
Correct |
24 ms |
3368 KB |
Output is correct |
90 |
Correct |
22 ms |
3440 KB |
Output is correct |
91 |
Correct |
23 ms |
3348 KB |
Output is correct |
92 |
Correct |
21 ms |
3348 KB |
Output is correct |
93 |
Correct |
23 ms |
3380 KB |
Output is correct |
94 |
Correct |
25 ms |
3308 KB |
Output is correct |
95 |
Correct |
29 ms |
3332 KB |
Output is correct |
96 |
Correct |
19 ms |
3308 KB |
Output is correct |
97 |
Correct |
32 ms |
3308 KB |
Output is correct |
98 |
Correct |
27 ms |
3436 KB |
Output is correct |
99 |
Correct |
23 ms |
3304 KB |
Output is correct |
100 |
Correct |
35 ms |
3380 KB |
Output is correct |
101 |
Correct |
23 ms |
3372 KB |
Output is correct |
102 |
Correct |
30 ms |
3372 KB |
Output is correct |
103 |
Correct |
23 ms |
3380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
560 ms |
49880 KB |
Output is correct |
2 |
Correct |
29 ms |
3308 KB |
Output is correct |
3 |
Correct |
533 ms |
49888 KB |
Output is correct |
4 |
Correct |
251 ms |
11192 KB |
Output is correct |
5 |
Correct |
275 ms |
19588 KB |
Output is correct |
6 |
Correct |
262 ms |
19460 KB |
Output is correct |
7 |
Correct |
262 ms |
18440 KB |
Output is correct |
8 |
Correct |
267 ms |
16800 KB |
Output is correct |
9 |
Correct |
23 ms |
3308 KB |
Output is correct |
10 |
Correct |
23 ms |
3308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
3308 KB |
Output is correct |
2 |
Correct |
23 ms |
3308 KB |
Output is correct |
3 |
Correct |
27 ms |
3300 KB |
Output is correct |
4 |
Correct |
26 ms |
3348 KB |
Output is correct |
5 |
Correct |
25 ms |
3308 KB |
Output is correct |
6 |
Correct |
20 ms |
3308 KB |
Output is correct |
7 |
Correct |
30 ms |
3300 KB |
Output is correct |
8 |
Correct |
23 ms |
3300 KB |
Output is correct |
9 |
Correct |
31 ms |
3300 KB |
Output is correct |
10 |
Correct |
21 ms |
3300 KB |
Output is correct |
11 |
Correct |
30 ms |
3300 KB |
Output is correct |
12 |
Correct |
32 ms |
3300 KB |
Output is correct |
13 |
Correct |
22 ms |
3336 KB |
Output is correct |
14 |
Correct |
31 ms |
3308 KB |
Output is correct |
15 |
Correct |
20 ms |
3308 KB |
Output is correct |
16 |
Correct |
34 ms |
3308 KB |
Output is correct |
17 |
Correct |
21 ms |
3300 KB |
Output is correct |
18 |
Correct |
21 ms |
3308 KB |
Output is correct |
19 |
Correct |
24 ms |
3308 KB |
Output is correct |
20 |
Correct |
24 ms |
3344 KB |
Output is correct |
21 |
Correct |
24 ms |
3308 KB |
Output is correct |
22 |
Correct |
20 ms |
3352 KB |
Output is correct |
23 |
Correct |
23 ms |
3308 KB |
Output is correct |
24 |
Correct |
22 ms |
3300 KB |
Output is correct |
25 |
Correct |
22 ms |
3308 KB |
Output is correct |
26 |
Correct |
21 ms |
3308 KB |
Output is correct |
27 |
Correct |
19 ms |
3308 KB |
Output is correct |
28 |
Correct |
21 ms |
3308 KB |
Output is correct |
29 |
Correct |
23 ms |
3308 KB |
Output is correct |
30 |
Correct |
21 ms |
3308 KB |
Output is correct |
31 |
Correct |
21 ms |
3280 KB |
Output is correct |
32 |
Correct |
23 ms |
3300 KB |
Output is correct |
33 |
Correct |
32 ms |
3300 KB |
Output is correct |
34 |
Correct |
21 ms |
3308 KB |
Output is correct |
35 |
Correct |
21 ms |
3300 KB |
Output is correct |
36 |
Correct |
26 ms |
3300 KB |
Output is correct |
37 |
Correct |
20 ms |
3300 KB |
Output is correct |
38 |
Correct |
21 ms |
3308 KB |
Output is correct |
39 |
Correct |
27 ms |
3308 KB |
Output is correct |
40 |
Correct |
21 ms |
3308 KB |
Output is correct |
41 |
Correct |
22 ms |
3300 KB |
Output is correct |
42 |
Correct |
30 ms |
3300 KB |
Output is correct |
43 |
Correct |
22 ms |
3308 KB |
Output is correct |
44 |
Correct |
21 ms |
3308 KB |
Output is correct |
45 |
Correct |
23 ms |
3308 KB |
Output is correct |
46 |
Correct |
23 ms |
3344 KB |
Output is correct |
47 |
Correct |
22 ms |
3300 KB |
Output is correct |
48 |
Correct |
33 ms |
3300 KB |
Output is correct |
49 |
Correct |
22 ms |
3284 KB |
Output is correct |
50 |
Correct |
31 ms |
3300 KB |
Output is correct |
51 |
Correct |
22 ms |
3328 KB |
Output is correct |
52 |
Correct |
22 ms |
3292 KB |
Output is correct |
53 |
Correct |
21 ms |
3308 KB |
Output is correct |
54 |
Correct |
25 ms |
3380 KB |
Output is correct |
55 |
Correct |
24 ms |
3380 KB |
Output is correct |
56 |
Correct |
24 ms |
3508 KB |
Output is correct |
57 |
Correct |
23 ms |
3372 KB |
Output is correct |
58 |
Correct |
21 ms |
3380 KB |
Output is correct |
59 |
Correct |
22 ms |
3380 KB |
Output is correct |
60 |
Correct |
22 ms |
3380 KB |
Output is correct |
61 |
Correct |
27 ms |
3372 KB |
Output is correct |
62 |
Correct |
22 ms |
3380 KB |
Output is correct |
63 |
Correct |
23 ms |
3380 KB |
Output is correct |
64 |
Correct |
30 ms |
3380 KB |
Output is correct |
65 |
Correct |
22 ms |
3372 KB |
Output is correct |
66 |
Correct |
22 ms |
3508 KB |
Output is correct |
67 |
Correct |
21 ms |
3380 KB |
Output is correct |
68 |
Correct |
25 ms |
3380 KB |
Output is correct |
69 |
Correct |
23 ms |
3380 KB |
Output is correct |
70 |
Correct |
30 ms |
3372 KB |
Output is correct |
71 |
Correct |
22 ms |
3380 KB |
Output is correct |
72 |
Correct |
20 ms |
3372 KB |
Output is correct |
73 |
Correct |
30 ms |
3372 KB |
Output is correct |
74 |
Correct |
24 ms |
3380 KB |
Output is correct |
75 |
Correct |
23 ms |
3380 KB |
Output is correct |
76 |
Correct |
22 ms |
3380 KB |
Output is correct |
77 |
Correct |
22 ms |
3372 KB |
Output is correct |
78 |
Correct |
22 ms |
3380 KB |
Output is correct |
79 |
Correct |
22 ms |
3372 KB |
Output is correct |
80 |
Correct |
21 ms |
3380 KB |
Output is correct |
81 |
Correct |
23 ms |
3380 KB |
Output is correct |
82 |
Correct |
21 ms |
3372 KB |
Output is correct |
83 |
Correct |
22 ms |
3380 KB |
Output is correct |
84 |
Correct |
21 ms |
3380 KB |
Output is correct |
85 |
Correct |
21 ms |
3376 KB |
Output is correct |
86 |
Correct |
24 ms |
3440 KB |
Output is correct |
87 |
Correct |
21 ms |
3380 KB |
Output is correct |
88 |
Correct |
22 ms |
3372 KB |
Output is correct |
89 |
Correct |
24 ms |
3368 KB |
Output is correct |
90 |
Correct |
22 ms |
3440 KB |
Output is correct |
91 |
Correct |
23 ms |
3348 KB |
Output is correct |
92 |
Correct |
21 ms |
3348 KB |
Output is correct |
93 |
Correct |
23 ms |
3380 KB |
Output is correct |
94 |
Correct |
25 ms |
3308 KB |
Output is correct |
95 |
Correct |
29 ms |
3332 KB |
Output is correct |
96 |
Correct |
19 ms |
3308 KB |
Output is correct |
97 |
Correct |
32 ms |
3308 KB |
Output is correct |
98 |
Correct |
27 ms |
3436 KB |
Output is correct |
99 |
Correct |
23 ms |
3304 KB |
Output is correct |
100 |
Correct |
35 ms |
3380 KB |
Output is correct |
101 |
Correct |
23 ms |
3372 KB |
Output is correct |
102 |
Correct |
30 ms |
3372 KB |
Output is correct |
103 |
Correct |
23 ms |
3380 KB |
Output is correct |
104 |
Correct |
560 ms |
49880 KB |
Output is correct |
105 |
Correct |
29 ms |
3308 KB |
Output is correct |
106 |
Correct |
533 ms |
49888 KB |
Output is correct |
107 |
Correct |
251 ms |
11192 KB |
Output is correct |
108 |
Correct |
275 ms |
19588 KB |
Output is correct |
109 |
Correct |
262 ms |
19460 KB |
Output is correct |
110 |
Correct |
262 ms |
18440 KB |
Output is correct |
111 |
Correct |
267 ms |
16800 KB |
Output is correct |
112 |
Correct |
23 ms |
3308 KB |
Output is correct |
113 |
Correct |
23 ms |
3308 KB |
Output is correct |
114 |
Correct |
293 ms |
38368 KB |
Output is correct |
115 |
Correct |
567 ms |
50548 KB |
Output is correct |
116 |
Correct |
304 ms |
36612 KB |
Output is correct |
117 |
Correct |
287 ms |
38392 KB |
Output is correct |
118 |
Correct |
540 ms |
50524 KB |
Output is correct |
119 |
Correct |
297 ms |
36508 KB |
Output is correct |
120 |
Correct |
557 ms |
50364 KB |
Output is correct |
121 |
Correct |
553 ms |
50408 KB |
Output is correct |
122 |
Correct |
519 ms |
50368 KB |
Output is correct |
123 |
Correct |
353 ms |
38712 KB |
Output is correct |
124 |
Correct |
550 ms |
50364 KB |
Output is correct |
125 |
Correct |
528 ms |
50400 KB |
Output is correct |
126 |
Correct |
540 ms |
50420 KB |
Output is correct |
127 |
Correct |
552 ms |
50656 KB |
Output is correct |
128 |
Correct |
287 ms |
38396 KB |
Output is correct |
129 |
Correct |
540 ms |
50408 KB |
Output is correct |
130 |
Correct |
526 ms |
50408 KB |
Output is correct |
131 |
Correct |
529 ms |
50424 KB |
Output is correct |
132 |
Correct |
517 ms |
50520 KB |
Output is correct |
133 |
Correct |
510 ms |
50532 KB |
Output is correct |
134 |
Correct |
281 ms |
36496 KB |
Output is correct |
135 |
Correct |
536 ms |
50404 KB |
Output is correct |
136 |
Correct |
287 ms |
38796 KB |
Output is correct |
137 |
Correct |
282 ms |
36596 KB |
Output is correct |
138 |
Correct |
291 ms |
36660 KB |
Output is correct |
139 |
Correct |
284 ms |
36600 KB |
Output is correct |
140 |
Correct |
273 ms |
38312 KB |
Output is correct |
141 |
Correct |
300 ms |
38844 KB |
Output is correct |
142 |
Correct |
528 ms |
50532 KB |
Output is correct |
143 |
Correct |
277 ms |
38768 KB |
Output is correct |
144 |
Correct |
305 ms |
38788 KB |
Output is correct |
145 |
Correct |
523 ms |
50420 KB |
Output is correct |
146 |
Correct |
528 ms |
50544 KB |
Output is correct |
147 |
Correct |
617 ms |
50400 KB |
Output is correct |
148 |
Correct |
542 ms |
50456 KB |
Output is correct |
149 |
Correct |
535 ms |
49732 KB |
Output is correct |
150 |
Correct |
520 ms |
49844 KB |
Output is correct |
151 |
Correct |
262 ms |
11196 KB |
Output is correct |
152 |
Correct |
260 ms |
19584 KB |
Output is correct |
153 |
Correct |
259 ms |
19592 KB |
Output is correct |
154 |
Correct |
323 ms |
18692 KB |
Output is correct |
155 |
Correct |
264 ms |
16956 KB |
Output is correct |
156 |
Correct |
20 ms |
3300 KB |
Output is correct |
157 |
Correct |
22 ms |
3308 KB |
Output is correct |
158 |
Correct |
309 ms |
36612 KB |
Output is correct |
159 |
Correct |
19 ms |
3308 KB |
Output is correct |
160 |
Correct |
512 ms |
50384 KB |
Output is correct |
161 |
Correct |
303 ms |
38824 KB |
Output is correct |
162 |
Correct |
281 ms |
36656 KB |
Output is correct |
163 |
Correct |
289 ms |
36548 KB |
Output is correct |