11736 | 2024-11-08 14:54:20 | redfoxdelta | Bob Baba Zárójelsorozata | python3 | Wrong answer 20/100 | 17ms | 3424 KiB |
N = int(input())
A = [int(i) for i in input().split()]
csuk = 0
z = ''
for i in range(N-1,-1,-1):
x = A[i]
if csuk >= x:
z = '(' * x + z
csuk -= x
else:
z = ')' * x + z
csuk += x
if csuk == 0:
print(z)
else:
print(-1)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3056 KiB | ||||
2 | Accepted | 16ms | 2872 KiB | ||||
3 | Accepted | 16ms | 2872 KiB | ||||
subtask2 | 20/20 | ||||||
4 | Accepted | 16ms | 3004 KiB | ||||
5 | Accepted | 16ms | 3088 KiB | ||||
6 | Accepted | 16ms | 3128 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 17ms | 2872 KiB | ||||
8 | Wrong answer | 16ms | 2872 KiB | ||||
9 | Wrong answer | 14ms | 3128 KiB | ||||
10 | Accepted | 16ms | 3064 KiB | ||||
11 | Wrong answer | 16ms | 3064 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Accepted | 17ms | 3128 KiB | ||||
13 | Wrong answer | 17ms | 3128 KiB | ||||
14 | Wrong answer | 17ms | 3152 KiB | ||||
15 | Wrong answer | 17ms | 3164 KiB | ||||
16 | Accepted | 17ms | 3272 KiB | ||||
17 | Accepted | 17ms | 3084 KiB | ||||
18 | Accepted | 16ms | 3128 KiB | ||||
19 | Wrong answer | 16ms | 3272 KiB | ||||
20 | Wrong answer | 17ms | 3128 KiB | ||||
21 | Wrong answer | 17ms | 3128 KiB | ||||
22 | Accepted | 17ms | 3132 KiB | ||||
23 | Accepted | 17ms | 3128 KiB | ||||
24 | Accepted | 17ms | 3128 KiB | ||||
25 | Wrong answer | 16ms | 3140 KiB | ||||
26 | Wrong answer | 14ms | 3048 KiB | ||||
27 | Accepted | 17ms | 3252 KiB | ||||
28 | Accepted | 16ms | 3128 KiB | ||||
29 | Accepted | 17ms | 3320 KiB | ||||
30 | Accepted | 16ms | 3320 KiB | ||||
31 | Wrong answer | 16ms | 3216 KiB | ||||
32 | Wrong answer | 16ms | 3216 KiB | ||||
33 | Accepted | 16ms | 3212 KiB | ||||
34 | Accepted | 17ms | 3340 KiB | ||||
35 | Accepted | 16ms | 3128 KiB | ||||
36 | Wrong answer | 16ms | 3128 KiB | ||||
37 | Wrong answer | 16ms | 3128 KiB | ||||
38 | Wrong answer | 17ms | 3072 KiB | ||||
39 | Wrong answer | 14ms | 2980 KiB | ||||
40 | Wrong answer | 17ms | 3124 KiB | ||||
41 | Wrong answer | 17ms | 3124 KiB | ||||
42 | Wrong answer | 17ms | 3424 KiB | ||||
43 | Wrong answer | 17ms | 3324 KiB | ||||
44 | Wrong answer | 16ms | 3216 KiB | ||||
45 | Wrong answer | 14ms | 3180 KiB | ||||
46 | Wrong answer | 16ms | 3048 KiB | ||||
47 | Wrong answer | 17ms | 3220 KiB | ||||
48 | Wrong answer | 17ms | 3128 KiB | ||||
49 | Wrong answer | 17ms | 3376 KiB | ||||
50 | Accepted | 17ms | 3256 KiB | ||||
51 | Wrong answer | 17ms | 3200 KiB | ||||
52 | Wrong answer | 17ms | 3216 KiB | ||||
53 | Wrong answer | 17ms | 3220 KiB | ||||
54 | Wrong answer | 17ms | 3312 KiB | ||||
55 | Wrong answer | 17ms | 3136 KiB | ||||
56 | Wrong answer | 17ms | 3128 KiB | ||||
57 | Wrong answer | 16ms | 3128 KiB | ||||
58 | Wrong answer | 16ms | 3128 KiB |