CF1023C.Bracket Subsequence

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line contains two integers nn and kk ( 2kn21052 \le k \le n \le 2 \cdot 10^5 , both nn and kk are even) — the length of ss and the length of the sequence you are asked to find.

The second line is a string ss — regular bracket sequence of length nn .

输入格式

Print a single string — a regular bracket sequence of length exactly kk such that it is also a subsequence of ss .

It is guaranteed that such sequence always exists.

输出格式

输入输出样例

  • 输入#1

    6 4
    ()(())
    

    输出#1

    ()()
    
  • 输入#2

    8 8
    (()(()))
    

    输出#2

    (()(()))
    
首页