Educational Codeforces Round 191 (Rated for Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2233 Educational Codeforces Round 191 (Rated for Div. 2) FINISHED False 7200 4893910 June 9, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 9406 ) C Cost of a Bracket Sequence PROGRAMMING brute force dp greedy

Let the cost of an arbitrary bracket string be the length of it's longest subsequence(^{\text{∗}}) that is a regular bracket sequence(^{\text{†}}). You are given a bracket string (s) and an integer (k). Your task is to remove at most (k) characters from the string (s) so that the cost of the resulting string is minimized. (^{\text{∗}})A sequence (a) is a subsequence of a sequence (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) element from arbitrary positions. (^{\text{†}})A bracket sequence is called regular if it is possible to obtain a correct arithmetic expression by inserting the characters (+) and (1) into this sequence. For example, the sequences "((())())", "(())", and "((()(())))" are regular, while "()()", "((())", and "((()))()" — are not. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^3)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le n \le 5\,000); (0 \le k \le n)) — the length of the string (s) and the maximum number of deletions. The second line of each test case contains a string (s) of length (n) consisting of the characters "(()" and/or "())". Additional input constraints: the sum of (n) over all test cases does not exceed (5\,000). For each test case, output a binary string of length (n). The (i)-th character should be equal to " 1 " if the corresponding character of the string (s) is removed, and " 0 " otherwise. The number of ones in the string must not exceed (k). The cost of the string obtained after removing the marked characters must be as small as possible. If there are several answers, output any of them. In the first test case, the cost of th

Tutorials

154371

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
378058992 mban259 C June 10, 2026, 9:28 a.m. OK C# 13 TESTS 14 109 3481600
378069548 panduwapanda C June 10, 2026, 11:05 a.m. OK C++17 (GCC 7-32) TESTS 14 15 0
378147610 anuragyadav12057 C June 11, 2026, 5:25 a.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378145854 KomeijiKoishi_Love C June 11, 2026, 5:01 a.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378145349 mohammadhabib C June 11, 2026, 4:55 a.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378137695 flowing_dusk C June 11, 2026, 2:29 a.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378132604 saina_hamid C June 10, 2026, 10:59 p.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378128639 Cellz C June 10, 2026, 8:43 p.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378123394 aditya0312 C June 10, 2026, 7:06 p.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378122882 badalkumar0159 C June 10, 2026, 6:59 p.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378119976 sumku C June 10, 2026, 6:24 p.m. OK C++17 (GCC 7-32) TESTS 14 31 0
378090943 Raghav021105 C June 10, 2026, 1:38 p.m. OK C++20 (GCC 13-64) TESTS 14 15 0
378144702 itsrijanpatel C June 11, 2026, 4:44 a.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378141448 Xx__Amar C June 11, 2026, 3:51 a.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378137999 arya_nsingh1254 C June 11, 2026, 2:37 a.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378136020 hehy0 C June 11, 2026, 1:31 a.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378129370 MaheshwariKushagra C June 10, 2026, 9:02 p.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378129051 SoumyavardhanMaheshwari C June 10, 2026, 8:53 p.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378128467 MrAngello C June 10, 2026, 8:39 p.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378125578 Crockz C June 10, 2026, 7:42 p.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378125021 Crockz C June 10, 2026, 7:32 p.m. OK C++20 (GCC 13-64) TESTS 14 31 0
378061672 my_cat_got_TLE C June 10, 2026, 9:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 15 0
378058131 kaynite07 C June 10, 2026, 9:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 15 0
378047479 _kaysar07 C June 10, 2026, 7:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 15 0
378150248 Otabek_Aynazarov C June 11, 2026, 5:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378148854 greninja04 C June 11, 2026, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378147063 dijkstra_bull C June 11, 2026, 5:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378146947 Rei_. C June 11, 2026, 5:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378145453 pritam-bsk C June 11, 2026, 4:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378145345 Yukihide C June 11, 2026, 4:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378144929 fzjsx C June 11, 2026, 4:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 31 0
378003551 Jiigrraaa04 C June 9, 2026, 5:37 p.m. OK Go TESTS 14 46 409600
378107780 hinny C June 10, 2026, 4:28 p.m. OK Java 21 TESTS 14 156 716800
378079919 dxtmanav C June 10, 2026, 11:56 a.m. OK Java 21 TESTS 14 171 1126400
378069258 heybigmars C June 10, 2026, 11:03 a.m. OK Java 21 TESTS 14 203 409600
378014360 aniketHacker C June 9, 2026, 7:45 p.m. OK Java 21 TESTS 14 203 409600
378147523 leen05 C June 11, 2026, 5:24 a.m. OK Java 21 TESTS 14 203 614400
378105860 nolimitmac C June 10, 2026, 4:08 p.m. OK Java 21 TESTS 14 203 819200
378098824 solver1808 C June 10, 2026, 2:54 p.m. OK Java 21 TESTS 14 203 921600
378036651 ezyabhinav_001 C June 10, 2026, 5:43 a.m. OK Java 21 TESTS 14 203 1126400
378109398 procrastinate7 C June 10, 2026, 4:44 p.m. OK Java 21 TESTS 14 203 1433600
378033561 justsaurab C June 10, 2026, 5 a.m. OK Java 21 TESTS 14 203 2150400
377995372 metharu88dl C June 9, 2026, 4:33 p.m. OK Java 8 TESTS 14 109 0
377996306 Abhishek_951 C June 9, 2026, 4:34 p.m. OK Java 8 TESTS 14 171 0
378000480 nesco C June 9, 2026, 5:06 p.m. OK Kotlin 2.2 TESTS 14 187 1740800
378002059 nesco C June 9, 2026, 5:21 p.m. OK Kotlin 2.2 TESTS 14 218 1740800
378061749 Bear_Bear_Lin C June 10, 2026, 9:52 a.m. OK Node.js TESTS 14 218 3174400
378023475 chinesedfan C June 10, 2026, 1:32 a.m. OK Node.js TESTS 14 468 8806400
378012430 EarthGo C June 9, 2026, 7:16 p.m. OK PyPy 3 TESTS 14 125 4710400
378113386 arnavtyagi2006 C June 10, 2026, 5:23 p.m. OK PyPy 3 TESTS 14 140 6963200
378030729 aprilhare25 C June 10, 2026, 4:14 a.m. OK PyPy 3 TESTS 14 171 4403200
378099567 shrigs03 C June 10, 2026, 3:02 p.m. OK PyPy 3 TESTS 14 187 5632000
378095598 R_A_Saha C June 10, 2026, 2:21 p.m. OK PyPy 3-64 TESTS 14 78 1536000
378064289 junhe_za C June 10, 2026, 10:16 a.m. OK PyPy 3-64 TESTS 14 78 2150400
378112547 htilalivada C June 10, 2026, 5:15 p.m. OK PyPy 3-64 TESTS 14 78 2355200
378090276 Jyotier C June 10, 2026, 1:32 p.m. OK PyPy 3-64 TESTS 14 78 3686400
378013785 biniyamnegasa C June 9, 2026, 7:36 p.m. OK PyPy 3-64 TESTS 14 93 2252800
378007635 VGCos C June 9, 2026, 6:18 p.m. OK PyPy 3-64 TESTS 14 93 2252800
378025111 kamio-misuzu C June 10, 2026, 2:22 a.m. OK PyPy 3-64 TESTS 14 93 3276800
377995622 zuba37 C June 9, 2026, 4:34 p.m. OK PyPy 3-64 TESTS 14 93 3584000
377995238 vedanshsinghal C June 9, 2026, 4:33 p.m. OK PyPy 3-64 TESTS 14 93 3686400
377998080 ZeAman77H C June 9, 2026, 4:46 p.m. OK PyPy 3-64 TESTS 14 93 5120000
378140019 gooonn C June 11, 2026, 3:24 a.m. OK Python 3 TESTS 14 46 307200
378116949 praxxnnt067 C June 10, 2026, 5:57 p.m. OK Python 3 TESTS 14 46 307200
378022634 NWUwzh123 C June 10, 2026, 12:59 a.m. OK Python 3 TESTS 14 46 1331200
378056218 Islam_Alshaer C June 10, 2026, 9:04 a.m. OK Python 3 TESTS 14 46 1843200
378122017 Tarun_4632 C June 10, 2026, 6:47 p.m. OK Python 3 TESTS 14 62 102400
377996281 vuthoo C June 9, 2026, 4:34 p.m. OK Python 3 TESTS 14 62 204800
378028276 Shadow_tree C June 10, 2026, 3:27 a.m. OK Python 3 TESTS 14 62 307200
378002272 Thecoolgrape C June 9, 2026, 5:24 p.m. OK Python 3 TESTS 14 78 307200
377996309 Biswajit_cp C June 9, 2026, 4:34 p.m. OK Python 3 TESTS 14 1546 204800

remove filters

Back to search problems