#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char s[];
int main(){
int k,n;
int zk;
int yk;
while(~scanf("%d%d",&n,&k)){
zk=;
yk=;
scanf("%s",s);
int lens=strlen(s);
for (int i=;i<lens;i++){
if (s[i]=='(' && zk<k/){
zk++;
printf("(");
}else if (s[i]==')' && yk<k/){
yk++;
printf(")");
}
}
printf("\n");
}
return ;
}

Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-C-Bracket Subsequence的更多相关文章

  1. E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    http://codeforces.com/contest/1023/problem/E 交互题 #include <cstdio> #include <cstdlib> #i ...

  2. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-D- Array Restoration

    我们知道不满足的肯定是两边大中间小的,这样就用RMQ查询两个相同等值的区间内部最小值即可,注意边界条件 #include<bits/stdc++.h> #define x first #d ...

  3. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)-A-Single Wildcard Pattern Matching

    #include<iostream> #include<algorithm> #include<stdio.h> #include<string.h> ...

  4. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) E. Down or Right

    从(1,1,n,n)每次只变一个坐标,进行询问. 如果问到对角线有距离限制, 再从(1,1,n/2,n/2)询问到(n/2,n/2,n,n) 记住前半部分贪心忘上走,后本部分贪心往右走 因为最后的路线 ...

  5. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    考场上只做出了ABDE C都挂了... 题解: A 题解: 模拟 判断前面一段是否相同,后面一段是否相同,长度是否够(不能有重叠) Code: #include<stdio.h> #inc ...

  6. D. Recovering BST Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    http://codeforces.com/contest/1025/problem/D 树 dp 优化 f[x][y][0]=f[x][z][1] & f[z+1][y][0] ( gcd( ...

  7. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) -B C(GCD,最长连续交替序列)

    B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 megabytes input ...

  8. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) B. Weakened Common Divis

    题目链接 让你找一个数,使得这个数,可以被每个二元组的两个数中的一个数整除. 先将第一个二元组的两个数质因数分解一下,分解的质数加入set中,然后,对剩下的n-1个二元组进行遍历,每次遍历到的二元组对 ...

  9. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

    A : A. Doggo Recoloring time limit per test 1 second memory limit per test 256 megabytes input stand ...

随机推荐

  1. Gnome增加消息提醒extension ( Fedora 28 )

    访问 https://extensions.gnome.org/ 网站(注意:需要安装 chrome-gnome-shell  rpm 包来使得系统能与Web Browser进行通信) 安装插件: n ...

  2. check

    private int AddNewstoDB(NewsModels newsModels, string dateTimeStr, string jsonStr, string cid, strin ...

  3. python中remove的一些坑

    前几天,使用python时遇到这么一个需求,删除一个列表中值为1的元素.我寻思着使用remove方法,但是remove方法只会删除第一个,于是我使用for循环去删除.代码和运行结果如下: 当时这个结果 ...

  4. IDEA 编译 Jmeter 5.0(二次开发)

    windows10 操作系统,jdk1.8,Intellij IDEA 2018,jmeter5.0 1.下载 http://jmeter.apache.org/download_jmeter.cgi ...

  5. 薛兆丰吴军何帆曾鸣万维刚李笑来罗永浩等得到APP专栏作者的书23本

    最近看了何帆的<大局观>,是他在得到APP的专栏文章的精选.顺便整理以下最近两三年内看过的得到APP其他专栏与课程作者的得到精选文集和他们写过的其他的书共23本. 薛兆丰 4星|<薛 ...

  6. Linux 小知识翻译 - 「小型移动式PC」

    这次介绍下新闻上提到的「小型移动式PC」.(这个当时日本新闻上的内容) 最近,经常在日本的大卖场中看到一种小型的移动式PC.不仅是小巧方便携带,而且价格也便宜.而且,省电功能的加入,使电池能工作更长的 ...

  7. Unity Ulua1.03优化记录

    现在项目的框架是在2015年设计的,那时候Ulua还处于1.03版本,现在回头再看,Ulua已经迭代到1.25版本,中间引入带有wraper的cstolua,而后转向现有的toLua#版本. 随着版本 ...

  8. MATLAB三维作图——隐函数

    MATLAB三维作图——隐函数 作者:凯鲁嘎吉 - 博客园http://www.cnblogs.com/kailugaji/ 对于三维隐函数,没有显式表达式,无法通过Matlab现成的3-D画图函数 ...

  9. [ADS]An installation support file could not be installed

    ADS:ARM Developer Suits 错误:An installation support file could not be installed 描述: 之前安装了一个不能用的ADS的版本 ...

  10. Windows安装pip方法

    1.下载pip 地址:https://pypi.python.org/pypi/pip#downloads 注意选择tar.gz压缩包,目前最新版本为9.0.1,这里选择的版本是:pip-9.0.1. ...