9707 | 2024-03-02 13:40:53 | szelland | Bob Baba Zárójelsorozata | python3 | Wrong answer 0/100 | 45ms | 16244 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 | Accepted | 18ms | 11276 KiB | ||||
2 | Accepted | 18ms | 11656 KiB | ||||
3 | Accepted | 17ms | 11696 KiB | ||||
subtask2 | 0/20 | ||||||
4 | Wrong answer | 30ms | 12396 KiB | ||||
5 | Wrong answer | 39ms | 12880 KiB | ||||
6 | Accepted | 23ms | 12144 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 18ms | 12428 KiB | ||||
8 | Wrong answer | 17ms | 12600 KiB | ||||
9 | Wrong answer | 17ms | 12900 KiB | ||||
10 | Wrong answer | 18ms | 12932 KiB | ||||
11 | Wrong answer | 18ms | 12996 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Wrong answer | 41ms | 14432 KiB | ||||
13 | Wrong answer | 41ms | 14516 KiB | ||||
14 | Wrong answer | 41ms | 14756 KiB | ||||
15 | Wrong answer | 41ms | 15000 KiB | ||||
16 | Wrong answer | 41ms | 14780 KiB | ||||
17 | Wrong answer | 41ms | 14848 KiB | ||||
18 | Wrong answer | 41ms | 14604 KiB | ||||
19 | Wrong answer | 43ms | 14724 KiB | ||||
20 | Wrong answer | 43ms | 14916 KiB | ||||
21 | Wrong answer | 43ms | 15040 KiB | ||||
22 | Wrong answer | 43ms | 14652 KiB | ||||
23 | Wrong answer | 41ms | 14868 KiB | ||||
24 | Wrong answer | 41ms | 14860 KiB | ||||
25 | Wrong answer | 43ms | 14976 KiB | ||||
26 | Wrong answer | 41ms | 14792 KiB | ||||
27 | Wrong answer | 43ms | 14808 KiB | ||||
28 | Wrong answer | 41ms | 14624 KiB | ||||
29 | Wrong answer | 43ms | 15000 KiB | ||||
30 | Wrong answer | 41ms | 14780 KiB | ||||
31 | Wrong answer | 41ms | 14816 KiB | ||||
32 | Wrong answer | 43ms | 14812 KiB | ||||
33 | Wrong answer | 43ms | 14996 KiB | ||||
34 | Wrong answer | 41ms | 14832 KiB | ||||
35 | Wrong answer | 41ms | 14968 KiB | ||||
36 | Wrong answer | 41ms | 15564 KiB | ||||
37 | Wrong answer | 41ms | 15600 KiB | ||||
38 | Wrong answer | 41ms | 15656 KiB | ||||
39 | Wrong answer | 43ms | 15708 KiB | ||||
40 | Wrong answer | 43ms | 15676 KiB | ||||
41 | Wrong answer | 43ms | 15576 KiB | ||||
42 | Wrong answer | 43ms | 15828 KiB | ||||
43 | Wrong answer | 43ms | 15660 KiB | ||||
44 | Wrong answer | 41ms | 15652 KiB | ||||
45 | Wrong answer | 45ms | 15400 KiB | ||||
46 | Wrong answer | 43ms | 15592 KiB | ||||
47 | Wrong answer | 43ms | 15796 KiB | ||||
48 | Wrong answer | 43ms | 15696 KiB | ||||
49 | Wrong answer | 43ms | 15644 KiB | ||||
50 | Wrong answer | 41ms | 15984 KiB | ||||
51 | Wrong answer | 43ms | 15852 KiB | ||||
52 | Wrong answer | 43ms | 15940 KiB | ||||
53 | Wrong answer | 43ms | 15892 KiB | ||||
54 | Wrong answer | 45ms | 15768 KiB | ||||
55 | Wrong answer | 41ms | 15952 KiB | ||||
56 | Wrong answer | 41ms | 16012 KiB | ||||
57 | Wrong answer | 41ms | 16244 KiB | ||||
58 | Wrong answer | 43ms | 16088 KiB |