9708 | 2024-03-02 13:41:16 | szelland | Bob Baba Zárójelsorozata | python3 | Wrong answer 0/100 | 46ms | 16140 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 | 11308 KiB | ||||
2 | Accepted | 17ms | 11724 KiB | ||||
3 | Accepted | 17ms | 11900 KiB | ||||
subtask2 | 0/20 | ||||||
4 | Wrong answer | 30ms | 12720 KiB | ||||
5 | Wrong answer | 37ms | 13064 KiB | ||||
6 | Accepted | 23ms | 12764 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 17ms | 12404 KiB | ||||
8 | Wrong answer | 17ms | 12376 KiB | ||||
9 | Wrong answer | 17ms | 12712 KiB | ||||
10 | Wrong answer | 18ms | 13084 KiB | ||||
11 | Wrong answer | 17ms | 13288 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Wrong answer | 41ms | 13956 KiB | ||||
13 | Wrong answer | 43ms | 14136 KiB | ||||
14 | Wrong answer | 41ms | 14500 KiB | ||||
15 | Wrong answer | 41ms | 14588 KiB | ||||
16 | Wrong answer | 43ms | 14628 KiB | ||||
17 | Wrong answer | 41ms | 14268 KiB | ||||
18 | Wrong answer | 41ms | 14436 KiB | ||||
19 | Wrong answer | 41ms | 14592 KiB | ||||
20 | Wrong answer | 43ms | 14708 KiB | ||||
21 | Wrong answer | 43ms | 15044 KiB | ||||
22 | Wrong answer | 41ms | 14812 KiB | ||||
23 | Wrong answer | 41ms | 14904 KiB | ||||
24 | Wrong answer | 41ms | 15120 KiB | ||||
25 | Wrong answer | 41ms | 15628 KiB | ||||
26 | Wrong answer | 41ms | 15404 KiB | ||||
27 | Wrong answer | 41ms | 15392 KiB | ||||
28 | Wrong answer | 41ms | 15040 KiB | ||||
29 | Wrong answer | 41ms | 15304 KiB | ||||
30 | Wrong answer | 46ms | 15204 KiB | ||||
31 | Wrong answer | 43ms | 15256 KiB | ||||
32 | Wrong answer | 41ms | 15348 KiB | ||||
33 | Wrong answer | 41ms | 15376 KiB | ||||
34 | Wrong answer | 43ms | 15024 KiB | ||||
35 | Wrong answer | 41ms | 15444 KiB | ||||
36 | Wrong answer | 43ms | 15708 KiB | ||||
37 | Wrong answer | 41ms | 15416 KiB | ||||
38 | Wrong answer | 41ms | 15728 KiB | ||||
39 | Wrong answer | 41ms | 15216 KiB | ||||
40 | Wrong answer | 41ms | 15600 KiB | ||||
41 | Wrong answer | 41ms | 15616 KiB | ||||
42 | Wrong answer | 41ms | 15512 KiB | ||||
43 | Wrong answer | 43ms | 15432 KiB | ||||
44 | Wrong answer | 41ms | 15544 KiB | ||||
45 | Wrong answer | 43ms | 15564 KiB | ||||
46 | Wrong answer | 45ms | 15676 KiB | ||||
47 | Wrong answer | 41ms | 15360 KiB | ||||
48 | Wrong answer | 41ms | 15504 KiB | ||||
49 | Wrong answer | 46ms | 15620 KiB | ||||
50 | Wrong answer | 43ms | 15448 KiB | ||||
51 | Wrong answer | 43ms | 15740 KiB | ||||
52 | Wrong answer | 43ms | 15488 KiB | ||||
53 | Wrong answer | 43ms | 15796 KiB | ||||
54 | Wrong answer | 43ms | 15680 KiB | ||||
55 | Wrong answer | 41ms | 16056 KiB | ||||
56 | Wrong answer | 41ms | 16140 KiB | ||||
57 | Wrong answer | 43ms | 15896 KiB | ||||
58 | Wrong answer | 41ms | 15932 KiB |