Codeforces Round 1073 (Div. 1)

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
2190 Codeforces Round 1073 (Div. 1) FINISHED False 10800 7745123 Jan. 17, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 10510 ) B1 Sub-RBS (Easy Version) PROGRAMMING combinatorics constructive algorithms dp greedy strings two pointers

This is the easy version of the problem. The difference between the versions is that in this version, you only need to evaluate for whole string (s), (s) is regular , and the constraints on (n) are higher . We say that a bracket sequence (a) is better than a bracket sequence (b) if one of the following holds: (b) is a prefix of (a), but (a \ne b); or let (i) be the first position (if it exists) where (a_i \neq b_i), then (\color{red}{a_i = (}) and (\color{red}{b_i = )}). You are given a regular bracket sequence (^{\text{∗}}) (s) of even length (n). Among all non-empty subsequences (^{\text{†}}) (t) of (s) that are regular bracket sequences , find the maximum possible length of (t) such that (t) is better than (s). If no such (t) exists, report it. (^{\text{∗}})A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting the characters (1) and (+) between the original characters of the sequence. For example: bracket sequences (()()) and ((())) are regular (the resulting expressions are ((1)+(1)) and (((1+1)+1))); bracket sequences ()(), ((), and ()) are not. (^{\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. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 2 \cdot 10^5), (n) is even) — the length of the string (s). The second line of each test case contains a sequence (s) of length (n) consisting only of character

Tutorials

Codeforces Round 1073 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
358285245 JakobZ B1 Jan. 17, 2026, 2:57 p.m. OK C++17 (GCC 7-32) TESTS 11 15 819200
358405913 Speedtortoise B1 Jan. 18, 2026, 4:46 a.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358399962 qAqua B1 Jan. 18, 2026, 2:48 a.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358399842 ashish1729 B1 Jan. 18, 2026, 2:45 a.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358395396 KnightWithSword B1 Jan. 18, 2026, 12:31 a.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358311473 Alpha_Q B1 Jan. 17, 2026, 3:28 p.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358311305 togetherfrist B1 Jan. 17, 2026, 3:28 p.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358311137 ram.bhakt B1 Jan. 17, 2026, 3:27 p.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358287070 luka.heric B1 Jan. 17, 2026, 2:58 p.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358283362 Dajid B1 Jan. 17, 2026, 2:55 p.m. OK C++17 (GCC 7-32) TESTS 11 31 0
358395686 __C_B__ B1 Jan. 18, 2026, 12:43 a.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358390976 rohan_singh_07 B1 Jan. 17, 2026, 9:43 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358390734 El_Farag B1 Jan. 17, 2026, 9:38 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358379971 lbm47 B1 Jan. 17, 2026, 7:18 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358376736 AmmarShereer B1 Jan. 17, 2026, 6:50 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358317982 outfinity B1 Jan. 17, 2026, 3:37 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358315507 Pottes B1 Jan. 17, 2026, 3:33 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358315070 cqbzlwz B1 Jan. 17, 2026, 3:33 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358313694 block_in_mc B1 Jan. 17, 2026, 3:31 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358306864 darrenhp B1 Jan. 17, 2026, 3:22 p.m. OK C++20 (GCC 13-64) TESTS 11 31 0
358413016 eliminator_101 B1 Jan. 18, 2026, 6:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358407834 MR_NoSolution B1 Jan. 18, 2026, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358407128 caterpillow B1 Jan. 18, 2026, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358404320 Raising_Heaven B1 Jan. 18, 2026, 4:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358401264 Continue90666 B1 Jan. 18, 2026, 3:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358394145 SalemAli B1 Jan. 17, 2026, 11:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358386920 shaantaanu B1 Jan. 17, 2026, 8:37 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358380058 Hem_kaushik B1 Jan. 17, 2026, 7:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358364698 salvini_god B1 Jan. 17, 2026, 5:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358360266 El_Medonho B1 Jan. 17, 2026, 5:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 11 31 0
358280047 hos.lyric B1 Jan. 17, 2026, 2:52 p.m. OK D TESTS 11 62 2662400
358299088 pengin_2000 B1 Jan. 17, 2026, 3:12 p.m. OK GNU C11 TESTS 11 15 204800
358343155 Ritwin B1 Jan. 17, 2026, 4:23 p.m. OK GNU C11 TESTS 11 15 1024000
358280210 scau_accepted B1 Jan. 17, 2026, 2:52 p.m. OK Go TESTS 11 46 1331200
358279889 showtime B1 Jan. 17, 2026, 2:51 p.m. OK Go TESTS 11 46 2867200
358297092 khuepr123 B1 Jan. 17, 2026, 3:09 p.m. OK Haskell TESTS 11 62 9523200
358299361 MBBN B1 Jan. 17, 2026, 3:12 p.m. OK Java 21 TESTS 11 218 819200
358309273 lybord B1 Jan. 17, 2026, 3:25 p.m. OK Java 21 TESTS 11 234 1945600
358287758 malachi_toney_goat B1 Jan. 17, 2026, 2:59 p.m. OK Java 8 TESTS 11 109 0
358272875 Tlatoani B1 Jan. 17, 2026, 2:45 p.m. OK Kotlin 2.2 TESTS 11 140 0
358301610 bcollet B1 Jan. 17, 2026, 3:15 p.m. OK PyPy 2 TESTS 11 93 2969600
358294323 imaiwluv B1 Jan. 17, 2026, 3:06 p.m. OK PyPy 3-64 TESTS 11 78 3584000
358299833 Friedrich B1 Jan. 17, 2026, 3:13 p.m. OK PyPy 3-64 TESTS 11 78 3891200
358305560 Emikooh B1 Jan. 17, 2026, 3:20 p.m. OK PyPy 3-64 TESTS 11 78 4096000
358311580 Maruzensky B1 Jan. 17, 2026, 3:28 p.m. OK PyPy 3-64 TESTS 11 78 4300800
358279799 kdy8128 B1 Jan. 17, 2026, 2:51 p.m. OK PyPy 3-64 TESTS 11 78 4300800
358303471 SnowLucario_Z B1 Jan. 17, 2026, 3:17 p.m. OK PyPy 3-64 TESTS 11 78 7884800
358333059 Ergodic137 B1 Jan. 17, 2026, 4:02 p.m. OK PyPy 3-64 TESTS 11 93 3788800
358284049 teekaytai B1 Jan. 17, 2026, 2:55 p.m. OK PyPy 3-64 TESTS 11 93 4198400
358279411 harurun4635 B1 Jan. 17, 2026, 2:51 p.m. OK PyPy 3-64 TESTS 11 93 4198400
358406169 am_aadvik B1 Jan. 18, 2026, 4:50 a.m. OK PyPy 3-64 TESTS 11 93 4300800
358296462 Jimanbanashi B1 Jan. 17, 2026, 3:09 p.m. OK Python 2 TESTS 11 62 0
358407103 coldfish123 B1 Jan. 18, 2026, 5:04 a.m. OK Python 3 TESTS 11 78 716800
358291894 sansen B1 Jan. 17, 2026, 3:03 p.m. OK Rust 2021 TESTS 11 46 102400
358281482 Solalyth B1 Jan. 17, 2026, 2:53 p.m. OK Rust 2021 TESTS 11 46 14848000
358295747 rusters B1 Jan. 17, 2026, 3:08 p.m. OK Rust 2021 TESTS 11 62 0
358281684 MoSooN B1 Jan. 17, 2026, 2:53 p.m. OK Rust 2021 TESTS 11 62 0
358343681 Darknef B1 Jan. 17, 2026, 4:24 p.m. OK Rust 2024 TESTS 11 46 0
358283175 Mon_ster B1 Jan. 17, 2026, 2:55 p.m. OK Rust 2024 TESTS 11 46 0
358274176 Sugar_fan B1 Jan. 17, 2026, 2:46 p.m. OK Rust 2024 TESTS 11 46 0
358304398 triple_affirmative B1 Jan. 17, 2026, 3:18 p.m. OK Rust 2024 TESTS 11 93 40960000

remove filters

Back to search problems