TopCoder

guagua0407
豬大哥

User's AC Ratio

100.0% (3/3)

Submission's AC Ratio

100.0% (3/3)

Tags

Description

Input Format

Output Format

Sample Input 1

4 1
()((

Sample Output 1

()()

Sample Input 2

10 6
)))))(((((

Sample Output 2

()(()()())

Sample Input 3

2 1
)(

Sample Output 3

-1

Sample Input 4

4 4
(())

Sample Output 4

-1

Sample Input 5

4 4
)()(

Sample Output 5

()()

Hints

Problem Source

112 學年度全國資訊學科能力競賽模擬賽

Subtasks

No. Testdata Range Constraints Score
1 0~4 範例測資 0
2 0~44 $N \leq 200$ 12
3 0~67 $N \leq 5000$ 36
4 0~101 無額外限制 52

Testdata and Limits

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