Codeforces Round 1002 (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
2059 Codeforces Round 1002 (Div. 2) FINISHED False 7200 37898722 Feb. 2, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 12478 ) C Customer Service PROGRAMMING brute force constructive algorithms graph matchings greedy math sortings

Nikyr has started working as a queue manager at the company "Black Contour." He needs to choose the order of servicing customers. There are a total of (n) queues, each initially containing (0) people. In each of the next (n) moments of time, there are two sequential events: New customers arrive in all queues. More formally, at the (j)-th moment of time, the number of people in the (i)-th queue increases by a positive integer (a_{i,j}). Nikyr chooses exactly one of the (n) queues to be served at that moment in time. The number of customers in this queue becomes (0). Let the number of people in the (i)-th queue after all events be (x_i). Nikyr wants MEX(^{\dagger}) of the collection (x_1, x_2, \ldots, x_n) to be as large as possible. Help him determine the maximum value he can achieve with an optimal order of servicing the queues. (^{\dagger})The minimum excluded (MEX) of a collection of integers (c_1, c_2, \ldots, c_k) is defined as the smallest non-negative integer (y) which does not occur in the collection (c). For example: (\operatorname{MEX}(2,2,1)= 0), since (0) does not belong to the array. (\operatorname{MEX}(3,1,0,1) = 2), since (0) and (1) belong to the array, but (2) does not. (\operatorname{MEX}(0,3,1,2) = 4), since (0), (1), (2), and (3) belong to the array, but (4) does not. Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \le t \le 2 \cdot 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \le n \le 300)) — the number of queues and moments of time. The (i)-th of the next (n) lines contains (n) integers (a_{i,1}, a_{i,2}, \ldots, a_{i,n}) ((1 \le a_{i,j} \le 10^9)) — the number of new customers in the (i)-th queue at each moment of time. It is guaranteed

Tutorials

139094

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
304220284 FrontierAlchemist C Feb. 3, 2025, 8:51 a.m. OK C# 10 TESTS 12 124 3993600
304301291 RedDevilVN C Feb. 3, 2025, 6:05 p.m. OK C++17 (GCC 7-32) TESTS 13 77 0
304255528 krrish_852 C Feb. 3, 2025, 1:24 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
304246036 kanshuman C Feb. 3, 2025, 12:17 p.m. OK C++17 (GCC 7-32) TESTS 12 77 0
304232788 razon_hasssan C Feb. 3, 2025, 10:34 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
304208319 Chandru_99 C Feb. 3, 2025, 4:52 a.m. OK C++17 (GCC 7-32) TESTS 12 77 0
304269260 Mohamed_Saad62 C Feb. 3, 2025, 2:43 p.m. OK C++17 (GCC 7-32) TESTS 12 77 102400
304264271 tleTauhid C Feb. 3, 2025, 2:16 p.m. OK C++17 (GCC 7-32) TESTS 12 77 102400
304244911 hvpatel.me C Feb. 3, 2025, 12:09 p.m. OK C++17 (GCC 7-32) TESTS 12 77 102400
304347821 codepplop C Feb. 4, 2025, 5:23 a.m. OK C++17 (GCC 7-32) TESTS 13 77 409600
304346510 ankush C Feb. 4, 2025, 5:06 a.m. OK C++17 (GCC 7-32) TESTS 13 77 409600
304196456 AEM_YNxingkong C Feb. 3, 2025, 1:30 a.m. OK C++20 (GCC 13-64) TESTS 12 46 1024000
304326591 ericzn248 C Feb. 3, 2025, 10:15 p.m. OK C++20 (GCC 13-64) TESTS 13 62 0
304325379 _Mahmoud_Ayman C Feb. 3, 2025, 9:54 p.m. OK C++20 (GCC 13-64) TESTS 13 62 0
304325315 _Mahmoud_Ayman2 C Feb. 3, 2025, 9:53 p.m. OK C++20 (GCC 13-64) TESTS 13 62 0
304242623 Saidam_Venkatesh C Feb. 3, 2025, 11:51 a.m. OK C++20 (GCC 13-64) TESTS 12 62 0
304204645 instantregret C Feb. 3, 2025, 4:03 a.m. OK C++20 (GCC 13-64) TESTS 12 62 0
304333795 jusantacruzc C Feb. 4, 2025, 1:10 a.m. OK C++20 (GCC 13-64) TESTS 13 62 102400
304309422 nish1044 C Feb. 3, 2025, 7:02 p.m. OK C++20 (GCC 13-64) TESTS 13 62 102400
304244438 dhruv_alr C Feb. 3, 2025, 12:05 p.m. OK C++20 (GCC 13-64) TESTS 12 62 102400
304233133 jocularferret C Feb. 3, 2025, 10:37 a.m. OK C++20 (GCC 13-64) TESTS 12 62 102400
304197893 cooluo C Feb. 3, 2025, 2:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 46 2457600
304309036 BABAYAGA__13 C Feb. 3, 2025, 6:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 62 0
304303515 sanketag23 C Feb. 3, 2025, 6:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 62 0
304256333 Guymmk C Feb. 3, 2025, 1:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 0
304245238 _kuragayala___ C Feb. 3, 2025, 12:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 0
304216321 Case2Hunter C Feb. 3, 2025, 8:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 0
304251112 derrick_g C Feb. 3, 2025, 12:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
304220719 7AM C Feb. 3, 2025, 8:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 12 62 102400
304337478 Momit_Mahir C Feb. 4, 2025, 2:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 77 0
304329594 BloomingSummerEnding C Feb. 3, 2025, 11:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 77 0
304193040 uffhottie C Feb. 3, 2025, 12:02 a.m. OK Go TESTS 12 62 3276800
304193170 uffhottie C Feb. 3, 2025, 12:05 a.m. OK Go TESTS 12 62 3584000
304193768 xylu C Feb. 3, 2025, 12:22 a.m. OK Go TESTS 12 77 3686400
304237581 shiou C Feb. 3, 2025, 11:13 a.m. OK Go TESTS 12 202 4300800
304261653 christmas964 C Feb. 3, 2025, 2:01 p.m. OK Java 21 TESTS 12 265 716800
304342210 d-light C Feb. 4, 2025, 4:02 a.m. OK Java 21 TESTS 13 280 614400
304303049 PlayDate C Feb. 3, 2025, 6:16 p.m. OK Java 21 TESTS 13 280 819200
304261522 Zeph340 C Feb. 3, 2025, 2 p.m. OK Java 21 TESTS 12 280 921600
304307523 shoaib54445 C Feb. 3, 2025, 6:47 p.m. OK Java 21 TESTS 13 281 614400
304299754 ThorOfWebDev C Feb. 3, 2025, 5:55 p.m. OK Java 21 TESTS 13 296 409600
304198068 akshatsaxena552004.ss C Feb. 3, 2025, 2:06 a.m. OK Java 21 TESTS 12 296 512000
304304975 Yousef_Badr C Feb. 3, 2025, 6:28 p.m. OK Java 21 TESTS 13 296 716800
304341377 vinaykhatri292 C Feb. 4, 2025, 3:50 a.m. OK Java 21 TESTS 13 296 921600
304199730 InfinityX C Feb. 3, 2025, 2:38 a.m. OK Java 21 TESTS 12 296 1228800
304292148 harsh_1806 C Feb. 3, 2025, 5:07 p.m. OK Java 8 TESTS 12 171 0
304281325 adibhai0845R C Feb. 3, 2025, 3:55 p.m. OK Java 8 TESTS 12 218 0
304202527 Dduo C Feb. 3, 2025, 3:30 a.m. OK Java 8 TESTS 12 233 0
304188916 smg_raza C Feb. 2, 2025, 10:35 p.m. OK Java 8 TESTS 12 405 0
304311238 Abhishek.B C Feb. 3, 2025, 7:17 p.m. OK Java 8 TESTS 13 406 0
304208287 snehakanodia4 C Feb. 3, 2025, 4:52 a.m. OK Java 8 TESTS 12 406 0
304312549 Abhishek.B C Feb. 3, 2025, 7:28 p.m. OK Java 8 TESTS 13 421 0
304301000 bansal_Sushi C Feb. 3, 2025, 6:03 p.m. OK Java 8 TESTS 13 437 0
304313186 123thirumal C Feb. 3, 2025, 7:34 p.m. OK Java 8 TESTS 13 468 0
304259626 devesh1207 C Feb. 3, 2025, 1:48 p.m. OK PyPy 3 TESTS 12 405 9625600
304252961 santhoshsparky C Feb. 3, 2025, 1:08 p.m. OK PyPy 3 TESTS 12 609 12595200
304200624 sanju_06 C Feb. 3, 2025, 2:57 a.m. OK PyPy 3 TESTS 12 639 9318400
304199401 minuki646 C Feb. 3, 2025, 2:31 a.m. OK PyPy 3-64 TESTS 12 124 5017600
304232148 elnazar C Feb. 3, 2025, 10:28 a.m. OK PyPy 3-64 TESTS 12 140 5734400
304303845 pierrot C Feb. 3, 2025, 6:20 p.m. OK PyPy 3-64 TESTS 13 140 7987200
304268359 kavorka C Feb. 3, 2025, 2:38 p.m. OK PyPy 3-64 TESTS 12 155 5324800
304183617 ekinAbstract C Feb. 2, 2025, 9:13 p.m. OK PyPy 3-64 TESTS 12 156 6348800
304298620 ChillCpGuy C Feb. 3, 2025, 5:48 p.m. OK PyPy 3-64 TESTS 13 171 8294400
304293068 naveents1915 C Feb. 3, 2025, 5:13 p.m. OK PyPy 3-64 TESTS 12 171 8294400
304292678 naveents1915 C Feb. 3, 2025, 5:10 p.m. OK PyPy 3-64 TESTS 12 171 8704000
304332787 ow3nL C Feb. 4, 2025, 12:45 a.m. OK PyPy 3-64 TESTS 13 202 7372800
304235895 monocrap C Feb. 3, 2025, 11 a.m. OK PyPy 3-64 TESTS 12 202 8089600
304184127 mquiller C Feb. 2, 2025, 9:19 p.m. OK Python 3 TESTS 12 155 17100800
304338998 alery C Feb. 4, 2025, 3:06 a.m. OK Python 3 TESTS 13 233 0
304306469 ok12 C Feb. 3, 2025, 6:39 p.m. OK Python 3 TESTS 13 234 5939200
304350055 Kiteretsuu C Feb. 4, 2025, 5:49 a.m. OK Python 3 TESTS 13 234 20480000
304234889 Harikaran14 C Feb. 3, 2025, 10:51 a.m. OK Python 3 TESTS 12 264 3686400
304201021 VSS201831_Subtain C Feb. 3, 2025, 3:04 a.m. OK Python 3 TESTS 12 265 0
304211488 shalinim10125 C Feb. 3, 2025, 5:31 a.m. OK Python 3 TESTS 12 265 3481600
304207640 ask812 C Feb. 3, 2025, 4:43 a.m. OK Python 3 TESTS 12 265 5939200
304212141 23110276 C Feb. 3, 2025, 5:38 a.m. OK Python 3 TESTS 12 280 4812800
304270342 Fine_stu C Feb. 3, 2025, 2:49 p.m. OK Python 3 TESTS 12 281 3584000
304231266 viniciusth C Feb. 3, 2025, 10:21 a.m. OK Rust 2021 TESTS 12 62 0
304187635 spookywooky C Feb. 2, 2025, 10:12 p.m. OK Rust 2021 TESTS 12 62 0
304252531 kalinov C Feb. 3, 2025, 1:05 p.m. OK Rust 2021 TESTS 12 93 102400

remove filters

Back to search problems