QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#68655#5108. Prehistoric ProgramsGuanYunchangTL 2073ms471400kbJava113.9kb2022-12-18 05:33:272022-12-18 05:33:30

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2073ms
memory: 471400kb

input:

50000
(
(
))))()))()(()))()()()))()(((((()(((()))()(((()))((()(())))))(()(
)
(
)
(((
(
(
(
(
(
()
(
)
(
)((())()((
)))))(
(
)
))
)()
(
)
)
)()(
(
(
()
(
)
(
)()((((())()))())(
(
(
)(
(
(
(()())())
)
)
(
(
(
)((())))((())))))))))((((()()))()))))))))((()())()))
)
)()
)
)
)
)
)
())(())))))()(()((()(())...

output:

1
2
5
7
8
9
10
11
12
13
14
16
19
23
27
28
29
30
32
34
35
37
38
42
43
44
54
55
58
59
61
65
69
70
72
76
77
79
80
87
91
92
93
94
95
96
97
99
103
112
116
117
118
120
122
125
126
127
128
129
130
131
133
135
136
143
146
147
148
149
150
151
154
161
162
163
164
165
166
169
172
175
176
177
178
179
181
182
18...

result:

ok good plan

Test #2:

score: 0
Accepted
time: 406ms
memory: 67892kb

input:

1000
(
))(()))
((((())())))((())(()))(
)(
)
)))
))((()(((((((())()(())()())))(()(())()())))))))((()((()())()())(())))()((()())
)((()()()(())(()))()(())()))(()))))())))))))))))))()))(()()(())(()))())()()))))(())()()()((())(()))(())))))))(()()())()))()())))()()))))))(
)))(((
(
)))()()())))
(
(((())(((...

output:

1
3
10
12
13
14
17
18
20
22
30
31
33
35
36
39
45
54
58
60
62
64
65
66
75
77
80
83
84
85
88
89
90
92
97
98
101
104
106
110
112
115
122
123
125
126
127
128
131
134
135
136
143
147
162
164
166
168
171
177
178
179
181
182
188
189
190
197
198
206
208
209
212
213
214
215
216
217
221
223
228
229
239
242
24...

result:

ok good plan

Test #3:

score: 0
Accepted
time: 120ms
memory: 53360kb

input:

2
()
()

output:

1
2

result:

ok good plan

Test #4:

score: 0
Accepted
time: 151ms
memory: 55532kb

input:

2
((
))

output:

1
2

result:

ok good plan

Test #5:

score: 0
Accepted
time: 125ms
memory: 51572kb

input:

2
)(
()

output:

impossible

result:

ok impossible

Test #6:

score: 0
Accepted
time: 114ms
memory: 53412kb

input:

3
()
(
)

output:

1
2
3

result:

ok good plan

Test #7:

score: 0
Accepted
time: 126ms
memory: 51820kb

input:

3
)(
(
)

output:

2
1
3

result:

ok good plan

Test #8:

score: 0
Accepted
time: 114ms
memory: 51884kb

input:

5
))(
(()
)(
(
)

output:

2
4
3
1
5

result:

ok good plan

Test #9:

score: 0
Accepted
time: 136ms
memory: 51628kb

input:

3
((
))())
(

output:

1
3
2

result:

ok good plan

Test #10:

score: 0
Accepted
time: 148ms
memory: 53232kb

input:

6
)
()
()()()
((
)
)

output:

impossible

result:

ok impossible

Test #11:

score: 0
Accepted
time: 221ms
memory: 54416kb

input:

500
(
)
)
(
)(
(
(
)
))(
(
(
(
(
)
)
(
(
)
(
(
)
(
()(()
(
)())
(
(
)
(
)()((
(
)
(
)
)
(
(
(
)
(
(
)
)
)(
(
(
)
)
(
)
(
(
(
)
(
(
())))
(
(
(
)
(
)
)
(
(
)
)
(
(
(
(
(
()
(
(
(
(
(
((
)
(
(
)
(
(
(
)
())
(
(
(
)
(
(
(
)
)
(
)
)
(
)
(
(
(
(
)
(
)
)
)
)
(
)
)))()(
(
)
)
(
)
)(
)
(
)
)
))
(
(
(
(
(
(
...

output:

1
4
6
7
10
11
12
13
16
17
19
20
22
23
24
26
27
29
31
33
36
37
38
40
41
45
46
49
51
52
53
55
56
58
59
60
62
65
66
69
70
71
72
73
74
75
76
77
78
79
80
82
83
85
86
87
90
91
92
94
95
96
99
102
104
105
106
107
109
114
117
120
124
128
129
130
131
132
133
136
139
141
143
149
152
153
156
157
158
159
160
166...

result:

ok good plan

Test #12:

score: 0
Accepted
time: 138ms
memory: 55476kb

input:

50
)
)
((((()())())))(())(())
()(((()))
(((()))(()
()(((
))
)
)()))(()(()())(((((()
(
)
)
)((
)()((
())()))
(())))()
(((
))))(()
()(())(()))())()
)
)
(
(
(
(
((())()())())))(((())
()(
(()(())()((()
()(((()())))())()(
)
)((()
(
)
((
)
()(
(
(
)
)))((())
)
()))()(((()(()
((
((()))(())(()())(()())())()...

output:

3
4
5
6
10
17
22
23
24
25
27
28
32
34
36
37
38
43
13
14
29
31
46
42
9
45
44
50
18
49
15
26
40
7
16
19
47
48
1
2
8
11
12
20
21
30
33
35
39
41

result:

ok good plan

Test #13:

score: 0
Accepted
time: 156ms
memory: 53596kb

input:

50
)
(
)()(
())(
()()(((((())(
)(())(()((())(()(()))(())())))))(())()))()())))))()(()()))(())))(()(((())(())()((())())()())(())())))()((()(()(())((()()))))()((((())()())((()))))((()()(())))))(()(())(()(()((())(()(())((()())))())(()))()())))()()((((()()((()()))((())())))()(())((()()((()((())())(()(()...

output:

2
5
8
11
13
15
16
18
26
28
33
40
41
46
47
3
4
10
19
37
42
44
29
21
6
31
12
36
17
23
39
1
7
9
14
20
22
24
25
27
30
32
34
35
38
43
45
48
49
50

result:

ok good plan

Test #14:

score: 0
Accepted
time: 186ms
memory: 54600kb

input:

150
))(()))(())(())))()))())()()()(())(((())))()))))()
)))()(()()(()((())())))(()(()(())((())))(((()(((())()()())))()())(((((((()))((())((())(())())(()))()(()()()()((((()))(()())))()(()((()(()(((((()((()())()))((((()))()))(()(((()()(((()(((()(((())(())())(()((()))))))()())((()(())())))((()()(()(((()...

output:

4
6
7
11
12
14
15
17
20
24
28
32
35
37
38
40
48
49
52
53
60
69
73
79
84
87
92
94
98
100
103
104
105
106
111
120
130
136
140
141
142
143
148
149
5
10
16
23
27
51
61
62
70
89
91
93
96
117
129
133
135
137
29
77
102
147
2
3
9
25
122
125
18
41
43
47
56
86
115
134
150
59
30
45
85
19
55
72
21
71
127
50
81
...

result:

ok good plan

Test #15:

score: 0
Accepted
time: 184ms
memory: 54168kb

input:

150
)))(
(()
(())((())))(()))()(()
((((()(((()))()(((((())()(()()((((()))((((()(())()(()))(()(())())(())(())))(((()))(())()))()((())((()(()(())())))))()(((()(()()())()))))()))(()(()()()(()(())()))))()))(((((())(()())((()()((((()))))(())())(())(())((()()(())))((((())((((()))()))()))))))))()())))))
(
...

output:

2
4
5
8
10
14
15
19
26
32
36
37
42
44
46
49
51
52
56
58
61
64
66
70
86
87
89
94
98
100
104
118
121
127
128
129
141
142
148
149
150
16
18
23
29
50
55
75
80
84
102
107
112
113
117
145
34
39
53
63
74
76
82
114
136
88
90
85
144
21
13
140
7
41
62
45
122
40
81
96
111
79
97
12
125
116
123
22
20
108
139
115...

result:

ok good plan

Test #16:

score: 0
Accepted
time: 183ms
memory: 55756kb

input:

150
)()((
)
)))())))
)()())((()(()())((())()))(()))(())((((((((()()(())())(()(((()))())()((()((())())))))))()((()))))((()(((()(((((()))()))((()((()()))(())))))()))))()())()()())(())(())(()))())((((((()()()))()((((()))))))((())()))()(()((()(())(())(())()())(())
()()
)
(())()))(())(()((())()()())())((...

output:

5
8
27
30
36
45
48
50
52
55
58
60
65
67
68
74
75
81
84
89
92
93
97
98
99
106
108
110
111
115
117
118
122
123
129
130
131
136
140
149
1
9
11
19
24
26
31
42
46
56
57
63
70
88
100
124
127
14
15
35
82
91
101
114
119
120
128
146
37
107
133
32
43
12
78
90
44
61
112
7
64
109
125
72
85
134
71
77
95
20
116
1...

result:

ok good plan

Test #17:

score: 0
Accepted
time: 334ms
memory: 65484kb

input:

750
(()()((()((((())()((()))()()))()))(()()(()))(()(())()))((((((
)))))))
)
((()()()(())((()(()())(())(((()((((()))(()(())((())(()())(())())))())))()(())()))((()(()((((()(()))(()())()((()()()))))(())())(())())())()((()(
)
)
(
)()(((()(())))()))))(((((((()))()()()(()())))(()())(()((
(
)
)(()))
((())(...

output:

1
4
7
9
13
16
17
19
20
21
22
25
27
34
37
41
43
45
48
55
56
57
58
62
65
66
67
69
74
79
80
81
82
95
97
101
103
104
105
108
112
116
121
122
131
136
138
141
148
149
150
152
155
156
157
158
159
160
162
163
164
166
169
172
175
176
180
181
182
184
185
186
191
195
197
204
208
212
213
214
218
220
224
225
227...

result:

ok good plan

Test #18:

score: 0
Accepted
time: 134ms
memory: 51636kb

input:

100
)
)
)
(
)
(
))))()
)
(
(
(
(
)
)
)
)
(
(
(
(
())
(
)
)
)((
)
(
(
(
)
(
(
)
)
)
)
()((
(
)
)
)
)(((
((((
(
)
(
)
((
)
(
(
)
(
())(()))
)
)
(
)
(
(
(
(
)))()()
)
(
(
(
(
)
(
)
)
)
(
)
)
)
)
(
)
(
(
)
(
)
(
(
(
)
)
(
)
)
(
)((((
)
)
()((()()(()))))
)
(

output:

4
6
9
10
11
12
17
18
19
20
22
27
28
29
31
32
37
38
43
44
46
48
50
51
53
57
59
60
61
62
65
66
67
68
70
74
79
81
82
84
86
87
88
91
94
100
25
42
95
7
63
54
1
2
3
5
8
13
14
15
16
21
23
24
26
30
33
34
35
36
39
40
41
45
47
49
52
55
56
58
64
69
71
72
73
75
76
77
78
80
83
85
89
90
92
93
96
97
98
99

result:

ok good plan

Test #19:

score: 0
Accepted
time: 135ms
memory: 50924kb

input:

100
)
()(
(
)
(
)
(
(
)
)
)(()
)
)))
)
)
(
(
(
)
(
(
)
(
)
(
(
(
))(
(
(
))((
(
)
(
))())
)
(()
)
)
(
)
(
(
)
)
(
)
(
))
(
(
)
)
(
)
)
)
)
(
())
)
(
(
)
)
(
)
(
))
(
)
)
(
(
(((
(
(
(()
)
)()())(()((()((())
(
)
)
(
(
)
)
(
)
(
)
(
))(
)
(
(
(
)
(
(((())

output:

impossible

result:

ok impossible

Test #20:

score: 0
Accepted
time: 158ms
memory: 55240kb

input:

100
)
)
()))((((
))()
(
(
(
)
(
)
(
(
)
()
(
(
)
)
(
)
(
(
)
)
)
(
)
)
(
(
)
)
(
)
)
)
)
(
(
)
((
(
(
)
)
(
(
)
(
)
(()((
)
(
)
)
(()))()()())))()()((
(
)
)
(
(
(
)
)
(
(
)
(
(
(
)
(
(
)
)(
(
)
)
)
(
(())())(()
)
)
(
()
((
(
)
)
)
)
(
)
(
(
)
)
(
())
)(

output:

5
6
7
9
11
12
14
15
16
19
21
22
26
29
30
33
38
39
41
42
43
46
47
49
51
53
57
60
61
62
65
66
68
69
70
72
73
76
80
84
85
86
87
92
94
95
98
75
81
100
3
56
4
1
2
8
10
13
17
18
20
23
24
25
27
28
31
32
34
35
36
37
40
44
45
48
50
52
54
55
58
59
63
64
67
71
74
77
78
79
82
83
88
89
90
91
93
96
97
99

result:

ok good plan

Test #21:

score: 0
Accepted
time: 136ms
memory: 51792kb

input:

100
(
(
)
(
)
(
(
(
(
)
)
)
)
()
)(
)
)
(
(
)
(
(
)
)
)
(
)
(
(
))))
(
)
(
)
(
(
(
()()(
)
())
(
(
)
)
(
(
)
(
(
)
)
(
(
(
(
(
)
(
(
(((
)
)
)
))))
(
))(
)
)
()
())()
)
)
(
)))
(
)((()))(
(
(((
((
(
)
(
(
)
(
)
)
()
)()
)
)
()))()(
)(())(
)
(
(
(
(
)(
)

output:

1
2
4
6
7
8
9
14
18
19
21
22
26
28
29
31
33
35
36
37
38
41
42
45
46
48
49
52
53
54
55
56
58
59
60
65
69
73
75
77
78
79
80
82
83
85
88
95
96
97
98
15
76
93
99
30
64
74
66
92
3
5
10
11
12
13
16
17
20
23
24
25
27
32
34
39
40
43
44
47
50
51
57
61
62
63
67
68
70
71
72
81
84
86
87
89
90
91
94
100

result:

ok good plan

Test #22:

score: 0
Accepted
time: 248ms
memory: 54968kb

input:

1000
(())())()(((())()())(((()(()))((()((((()())))())))))(()(()((())(((()))()(()
)
(
)
()
)
)((()))))
)
((((((()))()())))))((()(
((
()(()())))(()
)()
(
((
(
)
)
)(()
)))(
)
))
(
(()))))
)(())(((())((((
)
)
(
(
())))(())
(((
(
(((
())()(
()())
)
)
)
(
))))())(
)
))(
)
())(()(()))))()(()((())((((()())...

output:

impossible

result:

ok impossible

Test #23:

score: 0
Accepted
time: 219ms
memory: 56288kb

input:

1000
))(()))
(
)))(
)
((
()))()))))()()(
))))((((((((()()(())((()()
(
)
)()(()
(
()))))()
(
(()(()(((()())(((((((())()()())())(())()))))((()((())((((((()(()()
)(()())((()))
(((
)
)
(
)((
(
(
)
(
)
()(())(((
(
)
(
(
)
()(()(()()(()()((()))())((()())))))((())(((()()(())(()()())(()()(((())()(()((((((((...

output:

impossible

result:

ok impossible

Test #24:

score: 0
Accepted
time: 341ms
memory: 65012kb

input:

4000
(
)
))
)()))))(
(
)
(
)
)
)
)((()((
(
)
)()(
)
)
)
)
(
)
(
)
)
(
()))((()))))()((()(
(
)))
(
)
(
(
(
(
)
)()(()()(()()))))())
)
)
)(((
)
)
)
)
(
(
)
))()()))((())
(
(
)
(
))(
(
)
)
(
)
)
())(
)
(
(
(
)
())))(())((()(()()((()((
(
)
)
(
)
)
)
)
)
)
)
)
(
)
(()))))(
)
)
(
())))(((())()(
(
(
()(
(
...

output:

impossible

result:

ok impossible

Test #25:

score: -100
Time Limit Exceeded

input:

1000000
)
(
)()(((()))(
(
(
(
)
(
(
)
)
(((())((()(()((())
(
)
)(
)
)
))))(()))()())(()((()))(()()()))()()()))))))))(())))((((()(()()))((((((()((((()()(
)
((
)
)
(
)
())()()((
)
)))(())((()))((()()))(()(())())))())))())))(()()(
(
()(
(
(
()()
)
))
)
(
(
(
)
)
)
(
)
(
)
)
)
)(()))()))
(
)
)))
(
)
(
(...

output:


result: