9713 | 2024-03-02 14:09:31 | szelland | Bob Baba Zárójelsorozata | python3 | Wrong answer 0/100 | 45ms | 15792 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 | 17ms | 11260 KiB | ||||
2 | Accepted | 17ms | 11444 KiB | ||||
3 | Accepted | 17ms | 11528 KiB | ||||
subtask2 | 0/20 | ||||||
4 | Wrong answer | 30ms | 12660 KiB | ||||
5 | Wrong answer | 37ms | 12872 KiB | ||||
6 | Accepted | 23ms | 12352 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 17ms | 12464 KiB | ||||
8 | Wrong answer | 17ms | 12752 KiB | ||||
9 | Wrong answer | 17ms | 12688 KiB | ||||
10 | Wrong answer | 17ms | 12496 KiB | ||||
11 | Wrong answer | 17ms | 12616 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Wrong answer | 41ms | 14028 KiB | ||||
13 | Wrong answer | 41ms | 14012 KiB | ||||
14 | Wrong answer | 41ms | 13980 KiB | ||||
15 | Wrong answer | 41ms | 13912 KiB | ||||
16 | Wrong answer | 43ms | 14444 KiB | ||||
17 | Wrong answer | 41ms | 14420 KiB | ||||
18 | Wrong answer | 43ms | 14600 KiB | ||||
19 | Wrong answer | 43ms | 14664 KiB | ||||
20 | Wrong answer | 43ms | 14988 KiB | ||||
21 | Wrong answer | 41ms | 14804 KiB | ||||
22 | Wrong answer | 41ms | 14616 KiB | ||||
23 | Wrong answer | 41ms | 14684 KiB | ||||
24 | Wrong answer | 43ms | 14828 KiB | ||||
25 | Wrong answer | 43ms | 14964 KiB | ||||
26 | Wrong answer | 41ms | 14620 KiB | ||||
27 | Wrong answer | 45ms | 14804 KiB | ||||
28 | Wrong answer | 43ms | 15032 KiB | ||||
29 | Wrong answer | 41ms | 15096 KiB | ||||
30 | Wrong answer | 43ms | 15420 KiB | ||||
31 | Wrong answer | 43ms | 15448 KiB | ||||
32 | Wrong answer | 43ms | 15592 KiB | ||||
33 | Wrong answer | 43ms | 15712 KiB | ||||
34 | Wrong answer | 41ms | 15604 KiB | ||||
35 | Wrong answer | 41ms | 15752 KiB | ||||
36 | Wrong answer | 43ms | 15564 KiB | ||||
37 | Wrong answer | 43ms | 15644 KiB | ||||
38 | Wrong answer | 45ms | 15620 KiB | ||||
39 | Wrong answer | 43ms | 15360 KiB | ||||
40 | Wrong answer | 43ms | 15676 KiB | ||||
41 | Wrong answer | 41ms | 15568 KiB | ||||
42 | Wrong answer | 43ms | 15432 KiB | ||||
43 | Wrong answer | 43ms | 15480 KiB | ||||
44 | Wrong answer | 41ms | 15604 KiB | ||||
45 | Wrong answer | 43ms | 15704 KiB | ||||
46 | Wrong answer | 43ms | 15792 KiB | ||||
47 | Wrong answer | 43ms | 15624 KiB | ||||
48 | Wrong answer | 41ms | 15764 KiB | ||||
49 | Wrong answer | 43ms | 15636 KiB | ||||
50 | Wrong answer | 41ms | 15388 KiB | ||||
51 | Wrong answer | 43ms | 15740 KiB | ||||
52 | Wrong answer | 43ms | 15596 KiB | ||||
53 | Wrong answer | 41ms | 15656 KiB | ||||
54 | Wrong answer | 41ms | 15740 KiB | ||||
55 | Wrong answer | 41ms | 15656 KiB | ||||
56 | Wrong answer | 41ms | 15616 KiB | ||||
57 | Wrong answer | 41ms | 15588 KiB | ||||
58 | Wrong answer | 41ms | 15652 KiB |