116292024-11-01 21:36:20KezdőBob Baba Zárójelsorozatapython3Wrong answer 20/10017ms3476 KiB
N = int(input())
A = [int(i) for i in input().split()]
csuk = 0
z = ''
for i in range(N-1,-1,-1):
    x = A[i]
    if csuk >= x:
        z = '(' * x + z
        csuk -= x
    else:
        z = ')' * x + z
        csuk += x
if csuk == 0:
    print(z)
else:
    print(-1)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms2892 KiB
2Accepted14ms3092 KiB
3Accepted16ms2872 KiB
subtask220/20
4Accepted16ms3128 KiB
5Accepted16ms3128 KiB
6Accepted16ms3128 KiB
subtask30/30
7Wrong answer16ms3024 KiB
8Wrong answer16ms2980 KiB
9Wrong answer16ms2984 KiB
10Accepted16ms3128 KiB
11Wrong answer16ms2872 KiB
subtask40/50
12Accepted17ms3180 KiB
13Wrong answer17ms3140 KiB
14Wrong answer17ms3128 KiB
15Wrong answer17ms3128 KiB
16Accepted17ms3100 KiB
17Accepted17ms3120 KiB
18Accepted16ms3284 KiB
19Wrong answer16ms3248 KiB
20Wrong answer17ms3228 KiB
21Wrong answer17ms3128 KiB
22Accepted17ms3128 KiB
23Accepted17ms3124 KiB
24Accepted17ms3436 KiB
25Wrong answer16ms3240 KiB
26Wrong answer16ms3128 KiB
27Accepted16ms3132 KiB
28Accepted17ms3128 KiB
29Accepted16ms3128 KiB
30Accepted16ms3384 KiB
31Wrong answer16ms3140 KiB
32Wrong answer17ms3324 KiB
33Accepted17ms3128 KiB
34Accepted16ms3128 KiB
35Accepted16ms3128 KiB
36Wrong answer16ms3088 KiB
37Wrong answer17ms3212 KiB
38Wrong answer14ms3156 KiB
39Wrong answer16ms3140 KiB
40Wrong answer16ms3324 KiB
41Wrong answer16ms3144 KiB
42Wrong answer17ms3128 KiB
43Wrong answer16ms3372 KiB
44Wrong answer16ms3128 KiB
45Wrong answer16ms3312 KiB
46Wrong answer16ms3128 KiB
47Wrong answer16ms3428 KiB
48Wrong answer17ms3216 KiB
49Wrong answer16ms3128 KiB
50Accepted16ms3192 KiB
51Wrong answer16ms3224 KiB
52Wrong answer17ms3228 KiB
53Wrong answer17ms3128 KiB
54Wrong answer17ms3120 KiB
55Wrong answer17ms3144 KiB
56Wrong answer17ms3120 KiB
57Wrong answer17ms3128 KiB
58Wrong answer17ms3476 KiB