11629 | 2024-11-01 21:36:20 | Kezdő | Bob Baba Zárójelsorozata | python3 | Wrong answer 20/100 | 17ms | 3476 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 | 2892 KiB | ||||
2 | Accepted | 14ms | 3092 KiB | ||||
3 | Accepted | 16ms | 2872 KiB | ||||
subtask2 | 20/20 | ||||||
4 | Accepted | 16ms | 3128 KiB | ||||
5 | Accepted | 16ms | 3128 KiB | ||||
6 | Accepted | 16ms | 3128 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 16ms | 3024 KiB | ||||
8 | Wrong answer | 16ms | 2980 KiB | ||||
9 | Wrong answer | 16ms | 2984 KiB | ||||
10 | Accepted | 16ms | 3128 KiB | ||||
11 | Wrong answer | 16ms | 2872 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Accepted | 17ms | 3180 KiB | ||||
13 | Wrong answer | 17ms | 3140 KiB | ||||
14 | Wrong answer | 17ms | 3128 KiB | ||||
15 | Wrong answer | 17ms | 3128 KiB | ||||
16 | Accepted | 17ms | 3100 KiB | ||||
17 | Accepted | 17ms | 3120 KiB | ||||
18 | Accepted | 16ms | 3284 KiB | ||||
19 | Wrong answer | 16ms | 3248 KiB | ||||
20 | Wrong answer | 17ms | 3228 KiB | ||||
21 | Wrong answer | 17ms | 3128 KiB | ||||
22 | Accepted | 17ms | 3128 KiB | ||||
23 | Accepted | 17ms | 3124 KiB | ||||
24 | Accepted | 17ms | 3436 KiB | ||||
25 | Wrong answer | 16ms | 3240 KiB | ||||
26 | Wrong answer | 16ms | 3128 KiB | ||||
27 | Accepted | 16ms | 3132 KiB | ||||
28 | Accepted | 17ms | 3128 KiB | ||||
29 | Accepted | 16ms | 3128 KiB | ||||
30 | Accepted | 16ms | 3384 KiB | ||||
31 | Wrong answer | 16ms | 3140 KiB | ||||
32 | Wrong answer | 17ms | 3324 KiB | ||||
33 | Accepted | 17ms | 3128 KiB | ||||
34 | Accepted | 16ms | 3128 KiB | ||||
35 | Accepted | 16ms | 3128 KiB | ||||
36 | Wrong answer | 16ms | 3088 KiB | ||||
37 | Wrong answer | 17ms | 3212 KiB | ||||
38 | Wrong answer | 14ms | 3156 KiB | ||||
39 | Wrong answer | 16ms | 3140 KiB | ||||
40 | Wrong answer | 16ms | 3324 KiB | ||||
41 | Wrong answer | 16ms | 3144 KiB | ||||
42 | Wrong answer | 17ms | 3128 KiB | ||||
43 | Wrong answer | 16ms | 3372 KiB | ||||
44 | Wrong answer | 16ms | 3128 KiB | ||||
45 | Wrong answer | 16ms | 3312 KiB | ||||
46 | Wrong answer | 16ms | 3128 KiB | ||||
47 | Wrong answer | 16ms | 3428 KiB | ||||
48 | Wrong answer | 17ms | 3216 KiB | ||||
49 | Wrong answer | 16ms | 3128 KiB | ||||
50 | Accepted | 16ms | 3192 KiB | ||||
51 | Wrong answer | 16ms | 3224 KiB | ||||
52 | Wrong answer | 17ms | 3228 KiB | ||||
53 | Wrong answer | 17ms | 3128 KiB | ||||
54 | Wrong answer | 17ms | 3120 KiB | ||||
55 | Wrong answer | 17ms | 3144 KiB | ||||
56 | Wrong answer | 17ms | 3120 KiB | ||||
57 | Wrong answer | 17ms | 3128 KiB | ||||
58 | Wrong answer | 17ms | 3476 KiB |