Codeforces Round 899 (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
1882 Codeforces Round 899 (Div. 2) FINISHED False 7200 36170699 Sept. 25, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15588 ) B Sets and Union PROGRAMMING bitmasks brute force constructive algorithms greedy

B'You have n sets of integers S_{1}, S_{2}, ldots, S_{n} . We call a set S attainable, if it is possible to choose some (possibly, none) of the sets S_{1}, S_{2}, ldots, S_{n} so that S is equal to their union ^{ dagger} . If you choose none of S_{1}, S_{2}, ldots, S_{n} , their union is an empty set. Find the maximum number of elements in an attainable S such that S neq S_{1} cup S_{2} cup ldots cup S_{n} . ^{ dagger} The union of sets A_1, A_2, ldots, A_k is defined as the set of elements present in at least one of these sets. It is denoted by A_1 cup A_2 cup ldots cup A_k . For example, {2, 4, 6 } cup {2, 3 } cup {3, 6, 7 } = {2, 3, 4, 6, 7 } . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 50 ). The following n lines describe the sets S_1, S_2, ldots, S_n . The i -th of these lines contains an integer k_{i} ( 1 <= k_{i} <= 50 ) -- the number of elements in S_{i} , followed by k_{i} integers s_{i, 1}, s_{i, 2}, ldots, s_{i, k_{i}} ( 1 <= s_{i, 1} < s_{i, 2} < ldots < s_{i, k_{i}} <= 50 ) -- the elements of S_{i} . For each test case, print a single integer -- the maximum number of elements in an attainable S such that S neq S_{1} cup S_{2} cup ldots cup S_{n} . In the first test case, S = S_{1} cup S_{3} = {1, 2, 3, 4 } is the largest attainable set not equal to S_1 cup S_2 cup S_3 = {1, 2, 3, 4, 5 } . In the second test case, we can pick S = S_{2} cup S_{3} cup S_{4} = {2, 3, 4, 5, 6 } . In the third test case, we can pick S = S_{2} cup S_{5} = S_{2} cup S_{3} cup S_{5} = {3, 5, 6, 8, 9, 10 } . In the fourth test case, the only attainable set is S = v'...

Tutorials

Codeforces Round 899 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
225210134 lAMaLOSER B Sept. 26, 2023, 5:30 a.m. OK C# 10 TESTS 12 46 3276800
225202224 mban259 B Sept. 26, 2023, 3:29 a.m. OK C# 10 TESTS 12 155 3686400
225204340 bluemegane B Sept. 26, 2023, 4:03 a.m. OK C# 8 TESTS 12 171 3788800
225176155 NenadDapic B Sept. 25, 2023, 7:40 p.m. OK FPC TESTS 12 31 102400
225171681 0x81 B Sept. 25, 2023, 6:55 p.m. OK GNU C11 TESTS 12 15 0
225171781 0x81 B Sept. 25, 2023, 6:56 p.m. OK GNU C11 TESTS 12 15 0
225171218 0x81 B Sept. 25, 2023, 6:50 p.m. OK GNU C11 TESTS 12 31 0
225210563 Its_PT B Sept. 26, 2023, 5:36 a.m. OK GNU C11 TESTS 12 31 0
225191115 OvO_Zuo B Sept. 26, 2023, 12:12 a.m. OK GNU C++14 TESTS 12 15 0
225147132 dhuy198 B Sept. 25, 2023, 4:16 p.m. OK GNU C++14 TESTS 12 15 0
225193180 yinshenghang2008 B Sept. 26, 2023, 12:57 a.m. OK GNU C++14 TESTS 12 15 0
225186292 DeeGeeDow B Sept. 25, 2023, 10:06 p.m. OK GNU C++14 TESTS 12 15 102400
225149498 123asdf123 B Sept. 25, 2023, 4:23 p.m. OK GNU C++14 TESTS 12 15 204800
225146970 awayyy B Sept. 25, 2023, 4:16 p.m. OK GNU C++14 TESTS 12 15 204800
225197275 Kamisato_Ayaka B Sept. 26, 2023, 2:13 a.m. OK GNU C++14 TESTS 12 15 204800
225198710 rickyxrc B Sept. 26, 2023, 2:37 a.m. OK GNU C++14 TESTS 12 15 204800
225197732 dtta B Sept. 26, 2023, 2:21 a.m. OK GNU C++14 TESTS 12 15 204800
225165309 suru_korlam B Sept. 25, 2023, 6 p.m. OK GNU C++14 TESTS 12 15 307200
225198001 AnicoderAndy B Sept. 26, 2023, 2:26 a.m. OK GNU C++17 TESTS 12 15 0
225197262 RongYuzz B Sept. 26, 2023, 2:13 a.m. OK GNU C++17 TESTS 12 15 0
225189865 lilyyeung0112 B Sept. 25, 2023, 11:37 p.m. OK GNU C++17 TESTS 12 15 0
225184033 lucasma8795 B Sept. 25, 2023, 9:29 p.m. OK GNU C++17 TESTS 12 15 0
225181534 taemie B Sept. 25, 2023, 8:47 p.m. OK GNU C++17 TESTS 12 15 0
225172542 the_real_me99 B Sept. 25, 2023, 7:03 p.m. OK GNU C++17 TESTS 12 15 0
225206344 tungkhoa08 B Sept. 26, 2023, 4:37 a.m. OK GNU C++17 TESTS 12 15 0
225212457 monkeyDboa B Sept. 26, 2023, 6 a.m. OK GNU C++17 TESTS 12 15 0
225205832 Lucky_OvO B Sept. 26, 2023, 4:28 a.m. OK GNU C++17 TESTS 12 15 0
225210299 15H B Sept. 26, 2023, 5:32 a.m. OK GNU C++17 TESTS 12 15 102400
225194855 Njaso B Sept. 26, 2023, 1:28 a.m. OK GNU C++17 (64) TESTS 12 0 0
225165149 Hrishikesh1107 B Sept. 25, 2023, 5:59 p.m. OK GNU C++17 (64) TESTS 12 15 0
225191143 xxzx B Sept. 26, 2023, 12:13 a.m. OK GNU C++17 (64) TESTS 12 15 0
225169903 shiro53 B Sept. 25, 2023, 6:38 p.m. OK GNU C++17 (64) TESTS 12 15 0
225165010 Kasraa B Sept. 25, 2023, 5:57 p.m. OK GNU C++17 (64) TESTS 12 15 0
225158403 moursalinme B Sept. 25, 2023, 5:12 p.m. OK GNU C++17 (64) TESTS 12 15 102400
225202382 Sempr B Sept. 26, 2023, 3:31 a.m. OK GNU C++17 (64) TESTS 12 15 204800
225202160 sorry_Misono_Mika B Sept. 26, 2023, 3:28 a.m. OK GNU C++17 (64) TESTS 12 15 307200
225178756 rao_anil B Sept. 25, 2023, 8:10 p.m. OK GNU C++17 (64) TESTS 12 30 204800
225193220 Sgdd B Sept. 26, 2023, 12:58 a.m. OK GNU C++17 (64) TESTS 12 31 0
225149499 _Hridoy B Sept. 25, 2023, 4:23 p.m. OK GNU C++20 (64) TESTS 12 0 0
225176992 hipereg B Sept. 25, 2023, 7:49 p.m. OK GNU C++20 (64) TESTS 12 0 0
225194095 kmsgk B Sept. 26, 2023, 1:14 a.m. OK GNU C++20 (64) TESTS 12 0 0
225209302 gauravmahendraker B Sept. 26, 2023, 5:19 a.m. OK GNU C++20 (64) TESTS 12 0 0
225209451 5720226849 B Sept. 26, 2023, 5:21 a.m. OK GNU C++20 (64) TESTS 12 15 0
225209118 neo11235 B Sept. 26, 2023, 5:17 a.m. OK GNU C++20 (64) TESTS 12 15 0
225208916 Mikami B Sept. 26, 2023, 5:14 a.m. OK GNU C++20 (64) TESTS 12 15 0
225212058 nqmyiz B Sept. 26, 2023, 5:55 a.m. OK GNU C++20 (64) TESTS 12 15 0
225211135 fengxue2018 B Sept. 26, 2023, 5:43 a.m. OK GNU C++20 (64) TESTS 12 15 0
225210290 Farhod_Farmon B Sept. 26, 2023, 5:32 a.m. OK GNU C++20 (64) TESTS 12 15 0
225149715 Platinumda B Sept. 25, 2023, 4:23 p.m. OK Go TESTS 12 93 4403200
225148056 kibergrad B Sept. 25, 2023, 4:19 p.m. OK Go TESTS 12 623 4300800
225177791 prajwaldhule36 B Sept. 25, 2023, 7:58 p.m. OK Java 11 TESTS 12 202 0
225173426 TCchen B Sept. 25, 2023, 7:11 p.m. OK Java 11 TESTS 12 202 0
225173363 dark_rays B Sept. 25, 2023, 7:11 p.m. OK Java 11 TESTS 12 217 0
225173328 themadknight45 B Sept. 25, 2023, 7:11 p.m. OK Java 11 TESTS 12 217 0
225168594 vijender_8601 B Sept. 25, 2023, 6:26 p.m. OK Java 11 TESTS 12 218 0
225187110 theSSS B Sept. 25, 2023, 10:24 p.m. OK Java 11 TESTS 12 218 0
225200112 Pirate_coder82 B Sept. 26, 2023, 2:58 a.m. OK Java 11 TESTS 12 233 0
225198942 ImSoCrazy B Sept. 26, 2023, 2:40 a.m. OK Java 11 TESTS 12 249 0
225212381 urauraurie B Sept. 26, 2023, 5:59 a.m. OK Java 11 TESTS 12 264 0
225194060 wdjuruo B Sept. 26, 2023, 1:14 a.m. OK Java 11 TESTS 12 264 0
225210172 Spydee007 B Sept. 26, 2023, 5:31 a.m. OK Java 17 TESTS 12 202 716800
225208607 Spydee007 B Sept. 26, 2023, 5:11 a.m. OK Java 17 TESTS 12 218 102400
225210676 Nagendravarma B Sept. 26, 2023, 5:37 a.m. OK Java 17 TESTS 12 233 204800
225183445 vermadv2000 B Sept. 25, 2023, 9:18 p.m. OK Java 17 TESTS 12 233 512000
225147830 1isGreaterThan0 B Sept. 25, 2023, 4:18 p.m. OK Java 17 TESTS 12 233 512000
225179157 Harwinvanak B Sept. 25, 2023, 8:15 p.m. OK Java 17 TESTS 12 249 512000
225146617 mehrotramanvendra B Sept. 25, 2023, 4:15 p.m. OK Java 17 TESTS 12 249 614400
225150878 one_line B Sept. 25, 2023, 4:26 p.m. OK Java 17 TESTS 12 264 512000
225200341 prateeksama2003 B Sept. 26, 2023, 3:02 a.m. OK Java 17 TESTS 12 265 512000
225166903 aryanartist30 B Sept. 25, 2023, 6:12 p.m. OK Java 17 TESTS 12 265 921600
225156532 d2s2 B Sept. 25, 2023, 5:03 p.m. OK Java 21 TESTS 12 233 0
225148662 21501a0548 B Sept. 25, 2023, 4:20 p.m. OK Java 21 TESTS 12 311 0
225211492 Rachhh_04 B Sept. 26, 2023, 5:48 a.m. OK Java 21 TESTS 12 374 0
225176283 EliudGarcia2004 B Sept. 25, 2023, 7:41 p.m. OK Java 8 TESTS 12 108 0
225162910 laksj113 B Sept. 25, 2023, 5:42 p.m. OK Java 8 TESTS 12 124 0
225162700 bugEater B Sept. 25, 2023, 5:40 p.m. OK Java 8 TESTS 12 124 0
225170192 Sumitsingh7 B Sept. 25, 2023, 6:40 p.m. OK Java 8 TESTS 12 155 5939200
225168988 imstark007 B Sept. 25, 2023, 6:29 p.m. OK Java 8 TESTS 12 156 0
225168930 imstark007 B Sept. 25, 2023, 6:29 p.m. OK Java 8 TESTS 12 186 0
225146439 procoderomk B Sept. 25, 2023, 4:14 p.m. OK Java 8 TESTS 12 186 0
225152403 Nanthakumar06 B Sept. 25, 2023, 4:30 p.m. OK Java 8 TESTS 12 187 0
225146524 iwarrior062 B Sept. 25, 2023, 4:14 p.m. OK Java 8 TESTS 12 202 0
225205507 priyaroy3370 B Sept. 26, 2023, 4:23 a.m. OK Java 8 TESTS 12 233 0
225144244 aditya_coder9 B Sept. 25, 2023, 4:08 p.m. OK Kotlin 1.7 TESTS 12 1216 75468800
225175796 Alexit B Sept. 25, 2023, 7:36 p.m. OK MS C++ 2017 TESTS 12 46 102400
225161449 Antwerp2004 B Sept. 25, 2023, 5:31 p.m. OK MS C++ 2017 TESTS 12 124 102400
225210639 krish2004 B Sept. 26, 2023, 5:37 a.m. OK MS C++ 2017 TESTS 12 218 102400
225147149 krish2004 B Sept. 25, 2023, 4:16 p.m. OK MS C++ 2017 TESTS 12 624 307200
225151211 pulkitkumarmathur1 B Sept. 25, 2023, 4:27 p.m. OK PHP TESTS 12 170 0
225162017 Keval_78 B Sept. 25, 2023, 5:35 p.m. OK PyPy 3 TESTS 12 139 68812800
225206458 Shadow___Monarch B Sept. 26, 2023, 4:39 a.m. OK PyPy 3 TESTS 12 452 10342400
225183155 rmr B Sept. 25, 2023, 9:13 p.m. OK PyPy 3-64 TESTS 12 78 4300800
225191504 Eeezoe B Sept. 26, 2023, 12:21 a.m. OK PyPy 3-64 TESTS 12 93 5836800
225205344 Quick-One B Sept. 26, 2023, 4:20 a.m. OK PyPy 3-64 TESTS 12 109 4505600
225183002 rmr B Sept. 25, 2023, 9:11 p.m. OK PyPy 3-64 TESTS 12 109 5222400
225171591 grente B Sept. 25, 2023, 6:54 p.m. OK PyPy 3-64 TESTS 12 109 5427200
225186318 aaaaaaaaaa1 B Sept. 25, 2023, 10:06 p.m. OK PyPy 3-64 TESTS 12 109 5836800
225156956 codingfennel B Sept. 25, 2023, 5:04 p.m. OK PyPy 3-64 TESTS 12 124 5222400
225166668 DarkTemplarDrop B Sept. 25, 2023, 6:10 p.m. OK PyPy 3-64 TESTS 12 124 7680000
225146771 ilkhom B Sept. 25, 2023, 4:15 p.m. OK PyPy 3-64 TESTS 12 124 8294400
225208938 yukipom B Sept. 26, 2023, 5:15 a.m. OK PyPy 3-64 TESTS 12 124 8499200
225161391 1nsanity B Sept. 25, 2023, 5:30 p.m. OK Python 3 TESTS 12 93 0
225171929 daszybak B Sept. 25, 2023, 6:57 p.m. OK Python 3 TESTS 12 124 307200
225163977 eugalt B Sept. 25, 2023, 5:50 p.m. OK Python 3 TESTS 12 124 409600
225162377 eugalt B Sept. 25, 2023, 5:38 p.m. OK Python 3 TESTS 12 139 409600
225163565 XiaoXiaQWQ B Sept. 25, 2023, 5:47 p.m. OK Python 3 TESTS 12 155 0
225156506 mh__mh B Sept. 25, 2023, 5:03 p.m. OK Python 3 TESTS 12 155 102400
225172987 eugalt B Sept. 25, 2023, 7:08 p.m. OK Python 3 TESTS 12 155 2867200
225208362 aknov B Sept. 26, 2023, 5:07 a.m. OK Python 3 TESTS 12 171 204800
225153153 underlord B Sept. 25, 2023, 4:32 p.m. OK Python 3 TESTS 12 186 307200
225171696 VioletVal B Sept. 25, 2023, 6:55 p.m. OK Python 3 TESTS 12 202 102400
225151971 Nick2048 B Sept. 25, 2023, 4:29 p.m. OK Rust 2021 TESTS 12 15 102400
225147947 Rajveer_100 B Sept. 25, 2023, 4:18 p.m. OK Rust 2021 TESTS 12 31 409600
225146450 gr8den B Sept. 25, 2023, 4:14 p.m. OK Rust 2021 TESTS 12 31 716800
225161119 0npata B Sept. 25, 2023, 5:29 p.m. OK Rust 2021 TESTS 12 62 819200

remove filters

Back to search problems