116202024-10-31 22:17:32KezdőBob Baba Zárójelsorozatapython3Wrong answer 20/10017ms3428 KiB
N = int(input())
A = [int(i) for i in input().split()]
nyit = 0
z = ''
for x in A:
    if nyit-x >= 0:
        z += ')' * x
        nyit -= x
    else:
        z += '(' * x
        nyit += x
if nyit == 0:
    print(z)
else:
    print(-1)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3144 KiB
2Accepted14ms2872 KiB
3Accepted16ms3112 KiB
subtask220/20
4Accepted16ms2936 KiB
5Accepted16ms2968 KiB
6Accepted14ms3120 KiB
subtask30/30
7Wrong answer16ms3064 KiB
8Wrong answer16ms2868 KiB
9Wrong answer16ms3128 KiB
10Accepted16ms3064 KiB
11Wrong answer14ms3092 KiB
subtask40/50
12Accepted17ms3316 KiB
13Wrong answer17ms3316 KiB
14Wrong answer17ms3128 KiB
15Wrong answer17ms3128 KiB
16Accepted17ms3224 KiB
17Accepted17ms3284 KiB
18Accepted16ms3088 KiB
19Wrong answer17ms3248 KiB
20Wrong answer17ms3128 KiB
21Wrong answer17ms3128 KiB
22Accepted17ms3116 KiB
23Accepted17ms3124 KiB
24Accepted16ms3188 KiB
25Wrong answer17ms3128 KiB
26Wrong answer17ms3276 KiB
27Accepted17ms3088 KiB
28Accepted17ms3124 KiB
29Accepted17ms3144 KiB
30Accepted17ms3072 KiB
31Wrong answer16ms3128 KiB
32Wrong answer16ms3120 KiB
33Accepted16ms3128 KiB
34Accepted17ms3208 KiB
35Accepted17ms3184 KiB
36Wrong answer17ms3236 KiB
37Wrong answer17ms3428 KiB
38Wrong answer17ms3324 KiB
39Wrong answer16ms3128 KiB
40Wrong answer16ms3084 KiB
41Wrong answer16ms3076 KiB
42Wrong answer16ms3080 KiB
43Wrong answer16ms3088 KiB
44Wrong answer16ms3320 KiB
45Wrong answer16ms3140 KiB
46Wrong answer17ms3216 KiB
47Wrong answer16ms3324 KiB
48Wrong answer16ms3140 KiB
49Wrong answer16ms3324 KiB
50Wrong answer16ms3236 KiB
51Wrong answer17ms3152 KiB
52Wrong answer17ms3128 KiB
53Wrong answer17ms3236 KiB
54Wrong answer17ms3136 KiB
55Wrong answer17ms3152 KiB
56Wrong answer16ms3140 KiB
57Wrong answer17ms3140 KiB
58Wrong answer17ms3144 KiB