Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022

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
1726 Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 FINISHED False 8100 69348299 Sept. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12424 ) C Jatayu's Balanced Bracket Sequence PROGRAMMING data structures ds graphs

B'Last summer, Feluda gifted Lalmohan-Babu a balanced bracket sequence s of length 2 n . Topshe was bored during his summer vacations, and hence he decided to draw an undirected graph of 2 n vertices using the balanced bracket sequence s . For any two distinct vertices i and j ( 1 <= i < j <= 2 n ), Topshe draws an edge (undirected and unweighted) between these two nodes if and only if the subsegment s[i ldots j] forms a balanced bracket sequence. Determine the number of connected components in Topshe 's graph. See the Notes section for definitions of the underlined terms. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the number of opening brackets in string s . The second line of each test case contains a string s of length 2 n -- a balanced bracket sequence consisting of n opening brackets "(", and n closing brackets ")". It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output a single integer -- the number of connected components in Topshe 's graph. Sample explanation: In the first test case, the graph constructed from the bracket sequence (), is just a graph containing nodes 1 and 2 connected by a single edge. In the second test case, the graph constructed from the bracket sequence ()(()) would be the following (containing two connected components): Definition of Underlined Terms: '...

Tutorials

Codeforces Round #819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
171157661 Gassa C Sept. 6, 2022, 6:07 p.m. OK D TESTS 40 93 4403200
171169600 NenadDapic C Sept. 6, 2022, 8:12 p.m. OK FPC TESTS 40 280 2048000
171169857 NenadDapic C Sept. 6, 2022, 8:16 p.m. OK FPC TESTS 40 311 2048000
171149500 lordWolleh C Sept. 6, 2022, 4:47 p.m. OK GNU C11 TESTS 40 420 1740800
171145357 rons_07 C Sept. 6, 2022, 4:37 p.m. OK GNU C++14 TESTS 40 30 512000
171144795 kaotualtd C Sept. 6, 2022, 4:35 p.m. OK GNU C++14 TESTS 40 30 1536000
171145639 Midoria_7 C Sept. 6, 2022, 4:37 p.m. OK GNU C++14 TESTS 40 30 8396800
171148956 happycrazzy C Sept. 6, 2022, 4:46 p.m. OK GNU C++14 TESTS 40 31 204800
171148217 Esmael_Samir C Sept. 6, 2022, 4:44 p.m. OK GNU C++14 TESTS 40 31 204800
171196903 krvk55 C Sept. 7, 2022, 5:54 a.m. OK GNU C++14 TESTS 40 31 204800
171178480 hxlAKioi C Sept. 6, 2022, 11:29 p.m. OK GNU C++14 TESTS 40 31 409600
171190498 shreymishra2708 C Sept. 7, 2022, 4:06 a.m. OK GNU C++14 TESTS 40 31 512000
171190455 bluesquanium C Sept. 7, 2022, 4:05 a.m. OK GNU C++14 TESTS 40 31 512000
171195592 Ameen_Sha_786 C Sept. 7, 2022, 5:35 a.m. OK GNU C++14 TESTS 40 31 512000
171193499 AK_54 C Sept. 7, 2022, 5:01 a.m. OK GNU C++17 TESTS 40 15 8601600
171185916 harman_69 C Sept. 7, 2022, 2:28 a.m. OK GNU C++17 TESTS 40 30 512000
171183698 ankitkr22201 C Sept. 7, 2022, 1:40 a.m. OK GNU C++17 TESTS 40 30 512000
171180999 izrm C Sept. 7, 2022, 12:38 a.m. OK GNU C++17 TESTS 40 30 512000
171178752 Murinh0 C Sept. 6, 2022, 11:36 p.m. OK GNU C++17 TESTS 40 30 512000
171192157 roet C Sept. 7, 2022, 4:38 a.m. OK GNU C++17 TESTS 40 30 512000
171174817 thoi_bay_corona C Sept. 6, 2022, 9:54 p.m. OK GNU C++17 TESTS 40 30 512000
171167393 Omar_Hafez C Sept. 6, 2022, 7:41 p.m. OK GNU C++17 TESTS 40 30 512000
171165006 DioPhanTous C Sept. 6, 2022, 7:13 p.m. OK GNU C++17 TESTS 40 30 512000
171175638 Rabe3_ C Sept. 6, 2022, 10:15 p.m. OK GNU C++17 TESTS 40 30 512000
171166827 vk18_fan C Sept. 6, 2022, 7:34 p.m. OK GNU C++17 (64) TESTS 40 15 512000
171182058 kongfang89 C Sept. 7, 2022, 1:02 a.m. OK GNU C++17 (64) TESTS 40 15 512000
171168633 Muhammed_Ahmed C Sept. 6, 2022, 7:58 p.m. OK GNU C++17 (64) TESTS 40 15 512000
171147268 hangs C Sept. 6, 2022, 4:42 p.m. OK GNU C++17 (64) TESTS 40 30 0
171187815 Eter.nal C Sept. 7, 2022, 3:10 a.m. OK GNU C++17 (64) TESTS 40 30 204800
171184343 OLGA233 C Sept. 7, 2022, 1:54 a.m. OK GNU C++17 (64) TESTS 40 30 512000
171168291 Amanmaurya_2012 C Sept. 6, 2022, 7:53 p.m. OK GNU C++17 (64) TESTS 40 30 512000
171186448 ReSakura C Sept. 7, 2022, 2:40 a.m. OK GNU C++17 (64) TESTS 40 30 512000
171193370 iprom C Sept. 7, 2022, 4:59 a.m. OK GNU C++17 (64) TESTS 40 30 512000
171187417 -Victory- C Sept. 7, 2022, 3:02 a.m. OK GNU C++17 (64) TESTS 40 31 512000
171166905 soumyadeep_69 C Sept. 6, 2022, 7:34 p.m. OK GNU C++20 (64) TESTS 40 15 0
171166808 soumyadeep_69 C Sept. 6, 2022, 7:33 p.m. OK GNU C++20 (64) TESTS 40 15 0
171160302 koloskov25 C Sept. 6, 2022, 6:28 p.m. OK GNU C++20 (64) TESTS 40 15 204800
171156260 green_gold_dog C Sept. 6, 2022, 5:57 p.m. OK GNU C++20 (64) TESTS 40 15 307200
171195745 ro27 C Sept. 7, 2022, 5:37 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171196871 ForHXH C Sept. 7, 2022, 5:53 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171194169 ILHOM_45 C Sept. 7, 2022, 5:11 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171192647 mdjewelrana.cse.pust C Sept. 7, 2022, 4:46 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171192455 bgyyu12 C Sept. 7, 2022, 4:43 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171192407 wangcan_1 C Sept. 7, 2022, 4:42 a.m. OK GNU C++20 (64) TESTS 40 15 512000
171189517 satyaa_78 C Sept. 7, 2022, 3:47 a.m. OK Java 11 TESTS 40 187 0
171154759 IanISam C Sept. 6, 2022, 5:49 p.m. OK Java 11 TESTS 40 202 0
171144487 shivgarg321 C Sept. 6, 2022, 4:35 p.m. OK Java 11 TESTS 40 217 0
171150352 dinosparton_013 C Sept. 6, 2022, 4:49 p.m. OK Java 11 TESTS 40 248 4608000
171158356 Nimit_3 C Sept. 6, 2022, 6:12 p.m. OK Java 11 TESTS 40 343 51302400
171185946 dunkingdonuts C Sept. 7, 2022, 2:28 a.m. OK Java 11 TESTS 40 358 65433600
171171746 AyushS_cg170 C Sept. 6, 2022, 8:47 p.m. OK Java 11 TESTS 40 795 0
171146512 tushar_104 C Sept. 6, 2022, 4:40 p.m. OK Java 11 TESTS 40 810 0
171194044 aamir_1102 C Sept. 7, 2022, 5:09 a.m. OK Java 11 TESTS 40 826 0
171156482 x21svage C Sept. 6, 2022, 5:58 p.m. OK Java 11 TESTS 40 826 0
171149841 haloh_03 C Sept. 6, 2022, 4:48 p.m. OK Java 17 TESTS 40 280 204800
171193832 regalwolf C Sept. 7, 2022, 5:06 a.m. OK Java 17 TESTS 40 685 921600
171168529 AdityaGupta19 C Sept. 6, 2022, 7:56 p.m. OK Java 17 TESTS 40 686 1126400
171149654 Sanyam1 C Sept. 6, 2022, 4:47 p.m. OK Java 17 TESTS 40 717 921600
171161877 ganesh_6 C Sept. 6, 2022, 6:41 p.m. OK Java 8 TESTS 40 108 0
171184455 ganesh_6 C Sept. 7, 2022, 1:56 a.m. OK Java 8 TESTS 40 109 0
171154485 serndipty_ C Sept. 6, 2022, 5:48 p.m. OK Java 8 TESTS 40 109 0
171190303 Java_Programmer C Sept. 7, 2022, 4:02 a.m. OK Java 8 TESTS 40 124 0
171184265 rnss C Sept. 7, 2022, 1:53 a.m. OK Java 8 TESTS 40 124 0
171143469 Unrated_Pritam C Sept. 6, 2022, 4:32 p.m. OK Java 8 TESTS 40 139 0
171146273 ShivanRawat19 C Sept. 6, 2022, 4:39 p.m. OK Java 8 TESTS 40 140 0
171165471 dev_14 C Sept. 6, 2022, 7:18 p.m. OK Java 8 TESTS 40 171 15564800
171146140 TaukeKhan_ C Sept. 6, 2022, 4:39 p.m. OK Java 8 TESTS 40 577 75161600
171155338 vacom13 C Sept. 6, 2022, 5:52 p.m. OK Java 8 TESTS 40 764 95641600
171186174 6ziv C Sept. 7, 2022, 2:33 a.m. OK MS C++ 2017 TESTS 40 78 0
171149423 Ash_2k C Sept. 6, 2022, 4:47 p.m. OK MS C++ 2017 TESTS 40 389 1024000
171191989 Fish_L C Sept. 7, 2022, 4:35 a.m. OK MS C++ 2017 TESTS 40 420 614400
171195136 adesh123 C Sept. 7, 2022, 5:27 a.m. OK MS C++ 2017 TESTS 40 436 614400
171197313 misaka12435 C Sept. 7, 2022, 5:59 a.m. OK MS C++ 2017 TESTS 40 467 9318400
171144337 _Surtr C Sept. 6, 2022, 4:34 p.m. OK MS C++ 2017 TESTS 40 514 2457600
171155212 1_2_3_4_5_9 C Sept. 6, 2022, 5:51 p.m. OK PyPy 2 TESTS 40 139 11366400
171146505 Greyhound C Sept. 6, 2022, 4:40 p.m. OK PyPy 3 TESTS 40 233 30003200
171143579 artemmilov C Sept. 6, 2022, 4:32 p.m. OK PyPy 3 TESTS 40 1840 16588800
171154836 hsng299 C Sept. 6, 2022, 5:49 p.m. OK PyPy 3 TESTS 40 1871 9113600
171165325 samchen123 C Sept. 6, 2022, 7:16 p.m. OK PyPy 3-64 TESTS 40 77 5222400
171177234 hkwu6013 C Sept. 6, 2022, 10:55 p.m. OK PyPy 3-64 TESTS 40 124 6246400
171195110 PVR11 C Sept. 7, 2022, 5:27 a.m. OK PyPy 3-64 TESTS 40 124 6348800
171187996 InariInDream C Sept. 7, 2022, 3:14 a.m. OK PyPy 3-64 TESTS 40 124 6451200
171191634 dksdbtjd2 C Sept. 7, 2022, 4:27 a.m. OK PyPy 3-64 TESTS 40 124 9216000
171172513 biglunchdude C Sept. 6, 2022, 9:03 p.m. OK PyPy 3-64 TESTS 40 124 9420800
171154543 RockersElite C Sept. 6, 2022, 5:48 p.m. OK PyPy 3-64 TESTS 40 124 14028800
171159019 A_G C Sept. 6, 2022, 6:17 p.m. OK PyPy 3-64 TESTS 40 139 21811200
171161216 Turtleeee C Sept. 6, 2022, 6:35 p.m. OK PyPy 3-64 TESTS 40 140 8704000
171166641 aniketabhiraj2004 C Sept. 6, 2022, 7:32 p.m. OK PyPy 3-64 TESTS 40 140 9420800
171171190 hany.elnokaly C Sept. 6, 2022, 8:38 p.m. OK Python 3 TESTS 40 264 512000
171182706 pennymagic156 C Sept. 7, 2022, 1:17 a.m. OK Python 3 TESTS 40 358 13312000
171160996 saini.laxman2002 C Sept. 6, 2022, 6:33 p.m. OK Python 3 TESTS 40 576 207360000
171160430 saini.laxman2002 C Sept. 6, 2022, 6:29 p.m. OK Python 3 TESTS 40 592 207462400
171173072 rr745 C Sept. 6, 2022, 9:16 p.m. OK Python 3 TESTS 40 810 512000
171164614 AryanSehgal29 C Sept. 6, 2022, 7:08 p.m. OK Python 3 TESTS 40 810 512000
171194157 sheknows C Sept. 7, 2022, 5:11 a.m. OK Python 3 TESTS 40 826 512000
171169121 21bec036 C Sept. 6, 2022, 8:05 p.m. OK Python 3 TESTS 40 826 512000
171197101 minochaji C Sept. 7, 2022, 5:56 a.m. OK Python 3 TESTS 40 873 512000
171168983 dutin C Sept. 6, 2022, 8:03 p.m. OK Python 3 TESTS 40 873 512000
171156205 Hyrulia C Sept. 6, 2022, 5:57 p.m. OK Rust 2021 TESTS 40 546 2150400
171156740 Hyrulia C Sept. 6, 2022, 6 p.m. OK Rust 2021 TESTS 40 623 2150400

remove filters

Back to search problems