9712 | 2024-03-02 13:57:34 | Bandi2134 | Bob Baba Zárójelsorozata | python3 | Wrong answer 0/100 | 43ms | 15888 KiB |
def inSplit(l):
for i in range(len(l)):
l[i-1] = int(l[i-1])
return l
n = int(input())
m = list(input().split(" "))
m = inSplit(m)
p = sum(m)
k = [] # 0 > nyitó z jel, 1 > csuko z jel
a = True
nyit = 0
for i in m:
if nyit >= int(p / 2):
print(-1)
a = False
break
if nyit - i >= 0:
for j in range(i):
k.append(1)
nyit -= 1
else:
for j in range(i):
k.append(0)
nyit += 1
out = ""
for i in k:
if i == 0:
out += "("
else:
out += ")"
if a:
print(out)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 17ms | 11488 KiB | ||||
2 | Accepted | 18ms | 11660 KiB | ||||
3 | Accepted | 17ms | 11904 KiB | ||||
subtask2 | 0/20 | ||||||
4 | Wrong answer | 29ms | 12700 KiB | ||||
5 | Wrong answer | 37ms | 12804 KiB | ||||
6 | Wrong answer | 19ms | 12284 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 17ms | 12592 KiB | ||||
8 | Wrong answer | 17ms | 12672 KiB | ||||
9 | Wrong answer | 17ms | 12932 KiB | ||||
10 | Wrong answer | 17ms | 12820 KiB | ||||
11 | Wrong answer | 18ms | 12688 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Wrong answer | 41ms | 13768 KiB | ||||
13 | Wrong answer | 43ms | 14048 KiB | ||||
14 | Wrong answer | 41ms | 13996 KiB | ||||
15 | Wrong answer | 43ms | 14116 KiB | ||||
16 | Wrong answer | 43ms | 14568 KiB | ||||
17 | Wrong answer | 41ms | 14468 KiB | ||||
18 | Wrong answer | 41ms | 14652 KiB | ||||
19 | Wrong answer | 43ms | 14856 KiB | ||||
20 | Wrong answer | 43ms | 14540 KiB | ||||
21 | Wrong answer | 41ms | 14612 KiB | ||||
22 | Wrong answer | 41ms | 14416 KiB | ||||
23 | Wrong answer | 43ms | 14520 KiB | ||||
24 | Wrong answer | 41ms | 14516 KiB | ||||
25 | Wrong answer | 43ms | 14632 KiB | ||||
26 | Wrong answer | 41ms | 14944 KiB | ||||
27 | Wrong answer | 41ms | 15056 KiB | ||||
28 | Wrong answer | 41ms | 14740 KiB | ||||
29 | Wrong answer | 41ms | 15116 KiB | ||||
30 | Wrong answer | 43ms | 15076 KiB | ||||
31 | Wrong answer | 41ms | 15140 KiB | ||||
32 | Wrong answer | 41ms | 14916 KiB | ||||
33 | Wrong answer | 41ms | 15168 KiB | ||||
34 | Wrong answer | 41ms | 15324 KiB | ||||
35 | Wrong answer | 41ms | 15604 KiB | ||||
36 | Wrong answer | 41ms | 15556 KiB | ||||
37 | Wrong answer | 41ms | 15576 KiB | ||||
38 | Wrong answer | 43ms | 15548 KiB | ||||
39 | Wrong answer | 43ms | 15484 KiB | ||||
40 | Wrong answer | 41ms | 15384 KiB | ||||
41 | Wrong answer | 43ms | 15328 KiB | ||||
42 | Wrong answer | 43ms | 15520 KiB | ||||
43 | Wrong answer | 43ms | 15552 KiB | ||||
44 | Wrong answer | 41ms | 15408 KiB | ||||
45 | Wrong answer | 43ms | 15288 KiB | ||||
46 | Wrong answer | 41ms | 15568 KiB | ||||
47 | Wrong answer | 41ms | 15488 KiB | ||||
48 | Wrong answer | 43ms | 15332 KiB | ||||
49 | Wrong answer | 41ms | 15280 KiB | ||||
50 | Wrong answer | 41ms | 15420 KiB | ||||
51 | Wrong answer | 43ms | 15564 KiB | ||||
52 | Wrong answer | 43ms | 15720 KiB | ||||
53 | Wrong answer | 43ms | 15680 KiB | ||||
54 | Wrong answer | 43ms | 15584 KiB | ||||
55 | Wrong answer | 43ms | 15408 KiB | ||||
56 | Wrong answer | 41ms | 15728 KiB | ||||
57 | Wrong answer | 41ms | 15828 KiB | ||||
58 | Wrong answer | 41ms | 15888 KiB |