9710 | 2024-03-02 13:43:56 | Bandi2134 | Bob Baba Zárójelsorozata | python3 | Wrong answer 0/100 | 43ms | 15296 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 | 11368 KiB | ||||
2 | Accepted | 17ms | 11304 KiB | ||||
3 | Accepted | 17ms | 11432 KiB | ||||
subtask2 | 0/20 | ||||||
4 | Wrong answer | 29ms | 12432 KiB | ||||
5 | Wrong answer | 37ms | 12608 KiB | ||||
6 | Accepted | 21ms | 12244 KiB | ||||
subtask3 | 0/30 | ||||||
7 | Wrong answer | 17ms | 12060 KiB | ||||
8 | Wrong answer | 17ms | 12036 KiB | ||||
9 | Wrong answer | 19ms | 12244 KiB | ||||
10 | Wrong answer | 17ms | 12292 KiB | ||||
11 | Wrong answer | 17ms | 12648 KiB | ||||
subtask4 | 0/50 | ||||||
12 | Wrong answer | 41ms | 13696 KiB | ||||
13 | Wrong answer | 43ms | 13976 KiB | ||||
14 | Wrong answer | 41ms | 14224 KiB | ||||
15 | Wrong answer | 41ms | 14100 KiB | ||||
16 | Wrong answer | 41ms | 14104 KiB | ||||
17 | Wrong answer | 41ms | 14076 KiB | ||||
18 | Wrong answer | 41ms | 14332 KiB | ||||
19 | Wrong answer | 41ms | 14316 KiB | ||||
20 | Wrong answer | 41ms | 14504 KiB | ||||
21 | Wrong answer | 43ms | 14748 KiB | ||||
22 | Wrong answer | 41ms | 14616 KiB | ||||
23 | Wrong answer | 41ms | 14760 KiB | ||||
24 | Wrong answer | 41ms | 14596 KiB | ||||
25 | Wrong answer | 41ms | 14828 KiB | ||||
26 | Wrong answer | 43ms | 14908 KiB | ||||
27 | Wrong answer | 41ms | 14752 KiB | ||||
28 | Wrong answer | 41ms | 15032 KiB | ||||
29 | Wrong answer | 41ms | 14968 KiB | ||||
30 | Wrong answer | 43ms | 14932 KiB | ||||
31 | Wrong answer | 43ms | 14996 KiB | ||||
32 | Wrong answer | 39ms | 14856 KiB | ||||
33 | Wrong answer | 41ms | 14732 KiB | ||||
34 | Wrong answer | 41ms | 14696 KiB | ||||
35 | Wrong answer | 43ms | 15252 KiB | ||||
36 | Wrong answer | 43ms | 15192 KiB | ||||
37 | Wrong answer | 43ms | 14864 KiB | ||||
38 | Wrong answer | 41ms | 15088 KiB | ||||
39 | Wrong answer | 41ms | 14996 KiB | ||||
40 | Wrong answer | 41ms | 15148 KiB | ||||
41 | Wrong answer | 41ms | 15220 KiB | ||||
42 | Wrong answer | 43ms | 15064 KiB | ||||
43 | Wrong answer | 43ms | 15296 KiB | ||||
44 | Wrong answer | 41ms | 15224 KiB | ||||
45 | Wrong answer | 41ms | 15024 KiB | ||||
46 | Wrong answer | 43ms | 15196 KiB | ||||
47 | Wrong answer | 41ms | 15200 KiB | ||||
48 | Wrong answer | 43ms | 14904 KiB | ||||
49 | Wrong answer | 43ms | 14908 KiB | ||||
50 | Wrong answer | 41ms | 15056 KiB | ||||
51 | Wrong answer | 41ms | 15072 KiB | ||||
52 | Wrong answer | 43ms | 14896 KiB | ||||
53 | Wrong answer | 41ms | 15000 KiB | ||||
54 | Wrong answer | 43ms | 15096 KiB | ||||
55 | Wrong answer | 41ms | 15072 KiB | ||||
56 | Wrong answer | 41ms | 15144 KiB | ||||
57 | Wrong answer | 41ms | 14992 KiB | ||||
58 | Wrong answer | 41ms | 15048 KiB |