#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. Oracle 表操作(转)

    1.增加新字段:alter table table_name add (name varchar(20) default 'http://www.zangjing.net/');. 2.修改表字段:a ...

  2. tkinter学习系列(二)之窗口的设置

    目录 (一)窗体的最小框架 1.说明: 2.源代码: 3.实现效果: (二)窗体的基本设置 1.说明: 2.完整代码: 3.实现效果: (三)窗体的外形设置 1.说明: 2.完整代码: 3.实现效果: ...

  3. February 4th, 2018 Week 6th Sunday

    Hope clouds observation. 心怀希望会蒙蔽双眼,影响判断. Almost every of us thinks we would be the master of our liv ...

  4. Django 通过 session 保存个人信息

    通过 session 保存 个人 信息 登录的视图函数中: def login(request): ''' 登录 ''' err, user, pwd = '', '', '' if request. ...

  5. 最好的8个 Java RESTful 框架

    原文出处: colobu 过去的每一年,涌现出越来越多的Java框架.就像JavaScript,每个人都认为他们知道一个好的框架的功能应该是怎么样的.连我的老祖母现在也使用 一个我从来没有听说过而且可 ...

  6. Scala 类型界定

    class User(val userName: String,val age: Int) extends Comparable[User] { override def compareTo(o: U ...

  7. select * 和select 所有字段的区别

    文章取自http://blog.csdn.net/u014305991/article/details/44964171 MySQL 5.1.37 表记录数41,547,002,即4000w行 使用远 ...

  8. labellmg使用方法

    https://www.cnblogs.com/Terrypython/p/9577657.html

  9. 【UOJ 17】飞扬的小鸟

    UOJ 17 题意:在\(n\times m\)的网格中有一些柱子,它们可以通过的区间是\((L_i,R_i)\),位置在\(P_i\).在第i个位置点击一次会使高度增加\(X_i\),不点击会使高度 ...

  10. omcat+java的web程序持续占cpu高问题调试【转】

    1.top -c 2.查看具体线程 ps -m -p 30997 -o tid,%cpu,%mem > threads.log 3.printf %x 31865 其次将需要的线程ID转换为16 ...