Codeforces Round 1052 (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
2146 Codeforces Round 1052 (Div. 2) FINISHED False 8100 17940323 Sept. 21, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 15828 ) B Merging the Sets PROGRAMMING greedy implementation

You are given (n) sets (S_1,S_2,\ldots,S_n), where each element in the sets is an integer between (1) and (m). You want to choose some of the sets (possibly none or all), such that every integer between (1) and (m) is included in at least one of the chosen sets. You have to determine whether there exist at least three ways to choose the sets. 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 two integers (n) and (m) ((2 \leq n \leq 5\cdot 10^4), (1\le m \leq 10^5)) — the number of sets and the upper bound of the integers in the sets. Then (n) lines follow, the (i)-th line first containing an integer (l_i) ((1\le l_i\le m)) — the size of set (S_i). Then (l_i) integers (S_{i,1}, S_{i,2}, \ldots, S_{i, l_i}) follow in the same line ((1\le S_{i,1} < S_{i,2} < \cdots < S_{i, l_i}\le m)) — the elements of set (S_i). Let (L=\sum\limits_{i=1}^n l_i). It is guaranteed that: The sum of (n) over all test cases does not exceed (5\cdot 10^4); The sum of (m) over all test cases does not exceed (10^5); The sum of (L) over all test cases does not exceed (2\cdot 10^5). For each test case, print " YES " if there exist at least three ways to choose the sets. Otherwise, print " NO ". You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In the first test case, there are (5\ge 3) possible ways to choose the sets: (S_1) — both (1) and (2) are included in (S_1); (S_1) and (S_2) — (1) is included in (S_1) and (S_2), and (2) is included in (S_1); (S_1) and (S_3) — (1) is included in (S_1), and (2) is included in (S_1) and (S_3); (S_2) and

Tutorials

Codeforces Round 1052 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339831765 shant1blodm1 B Sept. 22, 2025, 5:27 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339827068 quochungpro2019 B Sept. 22, 2025, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339825793 Sarthakzzzzz B Sept. 22, 2025, 4:09 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339821589 karangautam B Sept. 22, 2025, 3:08 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339816156 YuLinShen_ B Sept. 22, 2025, 1:55 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339798441 nishthamehta2004 B Sept. 21, 2025, 7:01 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
339784276 bufferingblady B Sept. 21, 2025, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 11 77 0
339771565 Zayrex B Sept. 21, 2025, 4:13 p.m. OK C++17 (GCC 7-32) TESTS 11 77 102400
339812876 DangKhoizzzz B Sept. 22, 2025, 12:40 a.m. OK C++17 (GCC 7-32) TESTS 12 77 3993600
339833785 gswuyz1 B Sept. 22, 2025, 5:49 a.m. OK C++17 (GCC 7-32) TESTS 12 77 4096000
339835041 sif_69 B Sept. 22, 2025, 6:03 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339828606 xiaofanger B Sept. 22, 2025, 4:50 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339827459 nucifera B Sept. 22, 2025, 4:32 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339827142 _UnstoppableCoder_ B Sept. 22, 2025, 4:27 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339826612 LuOH3_ B Sept. 22, 2025, 4:20 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339813963 Mabingnan__V B Sept. 22, 2025, 1:12 a.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339807947 rharshita_12 B Sept. 21, 2025, 9:48 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339804982 Niravpokiya B Sept. 21, 2025, 8:38 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339804380 malustide_falcon B Sept. 21, 2025, 8:27 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339799299 OP_MAFIA B Sept. 21, 2025, 7:11 p.m. OK C++20 (GCC 13-64) TESTS 12 77 0
339832957 Catanoph B Sept. 22, 2025, 5:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339829844 B5_TranPhuongLinh B Sept. 22, 2025, 5:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339827568 MaxDYF B Sept. 22, 2025, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339823917 barikpriyam28 B Sept. 22, 2025, 3:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339821052 crocell001 B Sept. 22, 2025, 3 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339820943 2300770025 B Sept. 22, 2025, 2:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339820518 DB_SLSQ B Sept. 22, 2025, 2:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339818668 ButterLord B Sept. 22, 2025, 2:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339816028 BoolackOvO B Sept. 22, 2025, 1:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339814648 Woruo03 B Sept. 22, 2025, 1:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 77 0
339784779 M.H.Jim B Sept. 21, 2025, 4:49 p.m. OK GNU C11 TESTS 11 217 2150400
339813140 uffhottie B Sept. 22, 2025, 12:48 a.m. OK Go TESTS 12 77 3379200
339783718 kkumar-gcc B Sept. 21, 2025, 4:47 p.m. OK Go TESTS 11 124 4608000
339789357 treasuryonly B Sept. 21, 2025, 5:34 p.m. OK Haskell TESTS 11 358 32460800
339801748 stevie1024 B Sept. 21, 2025, 7:44 p.m. OK Haskell TESTS 12 530 40960000
339772864 nick_ninja B Sept. 21, 2025, 4:16 p.m. OK Java 21 TESTS 11 296 409600
339771104 rakesh4030 B Sept. 21, 2025, 4:12 p.m. OK Java 21 TESTS 11 296 512000
339770342 akshat.codes B Sept. 21, 2025, 4:10 p.m. OK Java 21 TESTS 11 296 614400
339828946 dhoensh B Sept. 22, 2025, 4:55 a.m. OK Java 21 TESTS 12 311 614400
339772610 RockingMat B Sept. 21, 2025, 4:16 p.m. OK Java 21 TESTS 11 312 5734400
339824815 s_mahata B Sept. 22, 2025, 3:56 a.m. OK Java 21 TESTS 12 342 1638400
339804958 jacksparrow53536 B Sept. 21, 2025, 8:38 p.m. OK Java 21 TESTS 12 343 102400
339776616 Pedro25 B Sept. 21, 2025, 4:27 p.m. OK Java 21 TESTS 11 343 409600
339827725 lilac7597 B Sept. 22, 2025, 4:36 a.m. OK Java 21 TESTS 12 343 2560000
339811578 vatsal_04 B Sept. 21, 2025, 11:58 p.m. OK Java 21 TESTS 12 343 5939200
339804733 abhayrajnegi0416 B Sept. 21, 2025, 8:34 p.m. OK Java 8 TESTS 12 233 3276800
339777430 cdytas B Sept. 21, 2025, 4:29 p.m. OK Java 8 TESTS 11 234 5529600
339783976 amre_8800 B Sept. 21, 2025, 4:48 p.m. OK Java 8 TESTS 11 234 15462400
339792504 multibagger B Sept. 21, 2025, 5:56 p.m. OK Java 8 TESTS 11 249 7680000
339802431 suntansoker B Sept. 21, 2025, 7:54 p.m. OK Java 8 TESTS 12 296 13107200
339772759 Boda82 B Sept. 21, 2025, 4:16 p.m. OK Java 8 TESTS 11 765 14950400
339801143 jagbarrameda B Sept. 21, 2025, 7:35 p.m. OK Kotlin 1.9 TESTS 12 405 31436800
339782592 sioe9 B Sept. 21, 2025, 4:44 p.m. OK Kotlin 2.2 TESTS 11 312 16896000
339804744 quad_recip B Sept. 21, 2025, 8:34 p.m. OK Kotlin 2.2 TESTS 12 405 21606400
339780419 practiceDaily1 B Sept. 21, 2025, 4:37 p.m. OK Node.js TESTS 11 374 26726400
339798855 Hxncus B Sept. 21, 2025, 7:06 p.m. OK PyPy 3 TESTS 12 187 11366400
339798488 Hxncus B Sept. 21, 2025, 7:01 p.m. OK PyPy 3 TESTS 12 217 11673600
339798013 Hxncus B Sept. 21, 2025, 6:56 p.m. OK PyPy 3 TESTS 12 233 11161600
339789903 siddheart2209 B Sept. 21, 2025, 5:37 p.m. OK PyPy 3 TESTS 11 265 10854400
339807294 gopikrishna9968 B Sept. 21, 2025, 9:29 p.m. OK PyPy 3 TESTS 12 265 16588800
339798731 Hxncus B Sept. 21, 2025, 7:04 p.m. OK PyPy 3 TESTS 12 280 13926400
339806351 gk787 B Sept. 21, 2025, 9:06 p.m. OK PyPy 3 TESTS 12 311 16691200
339825833 kaedeeeee B Sept. 22, 2025, 4:09 a.m. OK PyPy 3 TESTS 12 374 13516800
339777449 jsaddict044 B Sept. 21, 2025, 4:29 p.m. OK PyPy 3 TESTS 11 514 28979200
339782273 adityakudale2712 B Sept. 21, 2025, 4:43 p.m. OK PyPy 3 TESTS 11 578 13824000
339796782 _robosapiens_ B Sept. 21, 2025, 6:41 p.m. OK PyPy 3-64 TESTS 12 140 17408000
339794415 _robosapiens_ B Sept. 21, 2025, 6:15 p.m. OK PyPy 3-64 TESTS 12 140 19148800
339796693 _robosapiens_ B Sept. 21, 2025, 6:40 p.m. OK PyPy 3-64 TESTS 12 140 19251200
339795255 _robosapiens_ B Sept. 21, 2025, 6:24 p.m. OK PyPy 3-64 TESTS 12 156 19456000
339802106 PabloTeclado B Sept. 21, 2025, 7:49 p.m. OK PyPy 3-64 TESTS 12 156 25497600
339811769 _robosapiens_ B Sept. 22, 2025, 12:05 a.m. OK PyPy 3-64 TESTS 12 171 17305600
339775505 BakhtiyarZBJ B Sept. 21, 2025, 4:24 p.m. OK PyPy 3-64 TESTS 11 171 23859200
339783107 patwarinavin9 B Sept. 21, 2025, 4:46 p.m. OK PyPy 3-64 TESTS 11 186 19046400
339772081 CopyNinja6 B Sept. 21, 2025, 4:14 p.m. OK PyPy 3-64 TESTS 11 186 22528000
339792103 lwenkai B Sept. 21, 2025, 5:53 p.m. OK PyPy 3-64 TESTS 11 187 16486400
339811673 Taireyune B Sept. 22, 2025, 12:01 a.m. OK Python 3 TESTS 12 155 15872000
339773171 rohithkarthikeya48851 B Sept. 21, 2025, 4:17 p.m. OK Python 3 TESTS 11 171 17920000
339776685 Soundarya_Dube B Sept. 21, 2025, 4:27 p.m. OK Python 3 TESTS 11 171 22425600
339798076 ismai B Sept. 21, 2025, 6:56 p.m. OK Python 3 TESTS 12 186 23859200
339834944 focus_faith_137 B Sept. 22, 2025, 6:02 a.m. OK Python 3 TESTS 12 186 24678400
339779742 shseam B Sept. 21, 2025, 4:35 p.m. OK Python 3 TESTS 11 187 17510400
339803107 aaditya.samadhiya11 B Sept. 21, 2025, 8:06 p.m. OK Python 3 TESTS 12 202 16179200
339798038 parteekmalik5 B Sept. 21, 2025, 6:56 p.m. OK Python 3 TESTS 12 202 29798400
339779857 mithra.09 B Sept. 21, 2025, 4:36 p.m. OK Python 3 TESTS 11 203 22528000
339790785 modiharsh93 B Sept. 21, 2025, 5:43 p.m. OK Python 3 TESTS 11 233 17305600
339779124 WASDetchan B Sept. 21, 2025, 4:34 p.m. OK Rust 2024 TESTS 11 77 4198400
339817076 0x81 B Sept. 22, 2025, 2:07 a.m. OK Rust 2024 TESTS 12 92 614400

remove filters

Back to search problems