Codeforces Round 904 (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
1884 Codeforces Round 904 (Div. 2) FINISHED False 7200 39221663 Oct. 22, 2023, 7:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6344 ) C Medium Design PROGRAMMING data structures dp sortings

B'The array a_1, a_2, ldots, a_m is initially filled with zeroes. You are given n pairwise distinct segments 1 <= l_i <= r_i <= m . You have to select an arbitrary subset of these segments (in particular, you may select an empty set). Next, you do the following: Please, find the maximum cost among all subsets of segments. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= n <= 10^5 , 1 <= m <= 10^9 ) -- the number of segments and the length of the array. The following n lines of each test case describe the segments. The i -th of these lines contains two integers l_i and r_i ( 1 <= l_i <= r_i <= m ). It is guaranteed that the segments are pairwise distinct. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output the maximum cost among all subsets of the given set of segments. In the first test case, there is only one segment available. If we do not select it, then the array will be a = [0, 0, 0] , and the cost of such (empty) subset of segments will be 0 . If, however, we select the only segment, the array will be a = [0, 1, 0] , and the cost will be 1 - 0 = 1 . In the second test case, we can select all the segments: the array will be a = [0, 1, 2, 3, 2, 1, 0, 0] in this case. The cost will be 3 - 0 = 3 . '...

Tutorials

Codeforces Round #904 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
229177258 maskpark C Oct. 22, 2023, 8:21 a.m. OK C# 10 TESTS 14 405 33996800
229203136 Derato C Oct. 22, 2023, 10:58 a.m. OK C# 10 TESTS 14 1715 27852800
229173516 NenadDapic C Oct. 22, 2023, 8:09 a.m. OK FPC TESTS 14 171 4096000
229174930 ruban C Oct. 22, 2023, 8:14 a.m. OK FPC TESTS 14 577 225484800
229179363 pengin_2000 C Oct. 22, 2023, 8:29 a.m. OK GNU C11 TESTS 14 265 6451200
229176488 a999999 C Oct. 22, 2023, 8:19 a.m. OK GNU C++14 TESTS 14 46 5324800
229187590 lonely_log C Oct. 22, 2023, 8:59 a.m. OK GNU C++14 TESTS 14 124 2457600
229202724 Master640 C Oct. 22, 2023, 10:54 a.m. OK GNU C++14 TESTS 14 124 2457600
229203393 limulong C Oct. 22, 2023, 11 a.m. OK GNU C++14 TESTS 14 155 4812800
229184773 aditya.pca.25 C Oct. 22, 2023, 8:49 a.m. OK GNU C++14 TESTS 14 156 2457600
229173155 Muelsyse_sep002 C Oct. 22, 2023, 8:08 a.m. OK GNU C++14 TESTS 14 156 2457600
229190870 Schucking_Sattin C Oct. 22, 2023, 9:19 a.m. OK GNU C++14 TESTS 14 156 2457600
229191409 StranGePants C Oct. 22, 2023, 9:22 a.m. OK GNU C++14 TESTS 14 156 3993600
229178367 wxy2010 C Oct. 22, 2023, 8:25 a.m. OK GNU C++14 TESTS 14 156 18022400
229291554 Cornflakes C Oct. 22, 2023, 1:32 p.m. OK GNU C++14 TESTS 14 171 3993600
229202552 clc26765 C Oct. 22, 2023, 10:53 a.m. OK GNU C++17 TESTS 14 139 2457600
229332409 SteamTurbine C Oct. 22, 2023, 6:52 p.m. OK GNU C++17 TESTS 14 140 2048000
229198915 NosichGrig C Oct. 22, 2023, 10:19 a.m. OK GNU C++17 TESTS 14 155 5734400
229311805 vbsinha C Oct. 22, 2023, 3:50 p.m. OK GNU C++17 TESTS 14 156 4812800
229337135 Suhas_A_M C Oct. 22, 2023, 7:41 p.m. OK GNU C++17 TESTS 14 156 5529600
229336885 Suhas_A_M C Oct. 22, 2023, 7:38 p.m. OK GNU C++17 TESTS 14 170 5529600
229196001 hungntils C Oct. 22, 2023, 9:54 a.m. OK GNU C++17 TESTS 14 171 2457600
229200840 wikolego C Oct. 22, 2023, 10:36 a.m. OK GNU C++17 TESTS 14 171 2457600
229187969 Zadbebroni C Oct. 22, 2023, 9 a.m. OK GNU C++17 TESTS 14 171 2457600
229291909 1404394496 C Oct. 22, 2023, 1:38 p.m. OK GNU C++17 TESTS 14 171 2662400
229173993 hq1225 C Oct. 22, 2023, 8:11 a.m. OK GNU C++17 (64) TESTS 14 109 20070400
229175509 berekuk C Oct. 22, 2023, 8:16 a.m. OK GNU C++17 (64) TESTS 14 124 5222400
229196726 raidenblackout C Oct. 22, 2023, 10 a.m. OK GNU C++17 (64) TESTS 14 139 6758400
229183180 fyh20 C Oct. 22, 2023, 8:43 a.m. OK GNU C++17 (64) TESTS 14 140 3993600
229324593 augtheo C Oct. 22, 2023, 5:40 p.m. OK GNU C++17 (64) TESTS 14 140 5017600
229173657 stan23456 C Oct. 22, 2023, 8:10 a.m. OK GNU C++17 (64) TESTS 14 140 5324800
229304518 Dynamic_Pigeon C Oct. 22, 2023, 2:52 p.m. OK GNU C++17 (64) TESTS 14 140 5632000
229259799 7ms C Oct. 22, 2023, 12:20 p.m. OK GNU C++17 (64) TESTS 14 155 8089600
229179517 puffinmuffin C Oct. 22, 2023, 8:29 a.m. OK GNU C++17 (64) TESTS 14 155 13721600
229265287 YocyCraft C Oct. 22, 2023, 12:28 p.m. OK GNU C++17 (64) TESTS 14 156 6144000
229290088 xu826281112 C Oct. 22, 2023, 1:10 p.m. OK GNU C++20 (64) TESTS 14 78 9011200
229201819 Xapak C Oct. 22, 2023, 10:45 a.m. OK GNU C++20 (64) TESTS 14 93 1843200
229175010 Eslam_Saleh C Oct. 22, 2023, 8:14 a.m. OK GNU C++20 (64) TESTS 14 93 1843200
229172846 icewarrior52 C Oct. 22, 2023, 8:07 a.m. OK GNU C++20 (64) TESTS 14 93 2662400
229292225 xxcdsgyes C Oct. 22, 2023, 1:44 p.m. OK GNU C++20 (64) TESTS 14 93 2969600
229341728 DogAndCat C Oct. 22, 2023, 8:36 p.m. OK GNU C++20 (64) TESTS 14 93 3481600
229199648 Xapak C Oct. 22, 2023, 10:26 a.m. OK GNU C++20 (64) TESTS 14 93 3686400
229199579 -Abdulite C Oct. 22, 2023, 10:25 a.m. OK GNU C++20 (64) TESTS 14 93 3686400
229194646 sahil_beck C Oct. 22, 2023, 9:43 a.m. OK GNU C++20 (64) TESTS 14 93 3993600
229314977 JomnoiZ C Oct. 22, 2023, 4:17 p.m. OK GNU C++20 (64) TESTS 14 93 5017600
229175389 ZelKnow C Oct. 22, 2023, 8:15 a.m. OK Go TESTS 14 670 70860800
229337606 KlayThompson11 C Oct. 22, 2023, 7:46 p.m. OK Java 11 TESTS 14 483 15052800
229183763 yang9 C Oct. 22, 2023, 8:45 a.m. OK Java 11 TESTS 14 576 2355200
229175595 Ramez__ C Oct. 22, 2023, 8:16 a.m. OK Java 11 TESTS 14 655 3481600
229189122 wdjuruo C Oct. 22, 2023, 9:04 a.m. OK Java 11 TESTS 14 1123 35532800
229189153 chuquwan9964 C Oct. 22, 2023, 9:04 a.m. OK Java 11 TESTS 14 1185 18227200
229174883 kratos56 C Oct. 22, 2023, 8:14 a.m. OK Java 11 TESTS 14 1216 70246400
229181948 powervic08 C Oct. 22, 2023, 8:38 a.m. OK Java 11 TESTS 14 1496 67276800
229194749 themadknight45 C Oct. 22, 2023, 9:44 a.m. OK Java 11 TESTS 14 1513 34406400
229181334 lpk15014 C Oct. 22, 2023, 8:36 a.m. OK Java 17 TESTS 14 607 10342400
229319494 not_just_rr C Oct. 22, 2023, 4:55 p.m. OK Java 17 TESTS 14 608 39424000
229197304 the_unseen C Oct. 22, 2023, 10:05 a.m. OK Java 17 TESTS 14 639 9932800
229192356 Utsav82 C Oct. 22, 2023, 9:27 a.m. OK Java 17 TESTS 14 655 19763200
229317769 shingua77 C Oct. 22, 2023, 4:40 p.m. OK Java 17 TESTS 14 1044 819200
229180746 dzhi C Oct. 22, 2023, 8:34 a.m. OK Java 17 TESTS 14 2730 146944000
229192898 TopCloser C Oct. 22, 2023, 9:31 a.m. OK Java 17 TESTS 14 2885 127795200
229193895 TopCloser C Oct. 22, 2023, 9:38 a.m. OK Java 17 TESTS 14 2932 115404800
229192726 TopCloser C Oct. 22, 2023, 9:29 a.m. OK Java 17 TESTS 14 2978 128102400
229188790 TopCloser C Oct. 22, 2023, 9:03 a.m. OK Java 17 TESTS 14 2978 128102400
229344827 UncleBogdan C Oct. 22, 2023, 9:21 p.m. OK Java 21 TESTS 14 2043 38092800
229201395 safarisoul C Oct. 22, 2023, 10:41 a.m. OK Java 8 TESTS 14 389 0
229191069 jingxi C Oct. 22, 2023, 9:20 a.m. OK Java 8 TESTS 14 421 0
229172979 jingxi C Oct. 22, 2023, 8:08 a.m. OK Java 8 TESTS 14 452 0
229328490 Sumitsingh7 C Oct. 22, 2023, 6:14 p.m. OK Java 8 TESTS 14 608 28057600
229176007 Java_Programmer C Oct. 22, 2023, 8:17 a.m. OK Java 8 TESTS 14 858 10752000
229179233 a3g1s C Oct. 22, 2023, 8:28 a.m. OK Java 8 TESTS 14 1029 0
229192259 vatsal_04 C Oct. 22, 2023, 9:27 a.m. OK Java 8 TESTS 14 1231 8396800
229185573 UniversalAdmin C Oct. 22, 2023, 8:52 a.m. OK Java 8 TESTS 14 1621 31232000
229176035 yvbf C Oct. 22, 2023, 8:17 a.m. OK Java 8 TESTS 14 1840 75571200
229174750 invincible777 C Oct. 22, 2023, 8:13 a.m. OK Java 8 TESTS 14 1871 68198400
229202229 Ravitosh C Oct. 22, 2023, 10:50 a.m. OK MS C++ 2017 TESTS 14 421 6246400
229182744 maxK99 C Oct. 22, 2023, 8:41 a.m. OK MS C++ 2017 TESTS 14 545 8601600
229197206 Gaurav1 C Oct. 22, 2023, 10:04 a.m. OK PyPy 2 TESTS 14 733 46592000
229190973 jvatsal0709 C Oct. 22, 2023, 9:19 a.m. OK PyPy 3 TESTS 14 685 12083200
229190672 codeiitd C Oct. 22, 2023, 9:18 a.m. OK PyPy 3 TESTS 14 685 12083200
229362427 123gjweq2 C Oct. 23, 2023, 2:58 a.m. OK PyPy 3 TESTS 14 2059 27648000
229193820 the_last_smilodon C Oct. 22, 2023, 9:37 a.m. OK PyPy 3 TESTS 14 2870 49664000
229173039 hxu10 C Oct. 22, 2023, 8:08 a.m. OK PyPy 3-64 TESTS 14 530 41574400
229185948 gardengnome C Oct. 22, 2023, 8:53 a.m. OK PyPy 3-64 TESTS 14 639 49971200
229311522 mathdude42 C Oct. 22, 2023, 3:48 p.m. OK PyPy 3-64 TESTS 14 748 28774400
229196605 iN_siDious C Oct. 22, 2023, 9:58 a.m. OK PyPy 3-64 TESTS 14 748 33792000
229192968 gardengnome C Oct. 22, 2023, 9:31 a.m. OK PyPy 3-64 TESTS 14 811 59699200
229191938 Mohamed_Hamed C Oct. 22, 2023, 9:25 a.m. OK PyPy 3-64 TESTS 14 873 56934400
229178824 Age8 C Oct. 22, 2023, 8:27 a.m. OK PyPy 3-64 TESTS 14 873 129638400
229188254 Jayg000e C Oct. 22, 2023, 9:01 a.m. OK PyPy 3-64 TESTS 14 1153 17612800
229199124 Arnab_Goyal C Oct. 22, 2023, 10:21 a.m. OK PyPy 3-64 TESTS 14 1169 97280000
229182619 PROELECTRO444 C Oct. 22, 2023, 8:40 a.m. OK PyPy 3-64 TESTS 14 1278 55603200
229352628 AhtheUncertainty C Oct. 22, 2023, 10:40 p.m. OK Python 3 TESTS 14 1606 65024000
229180855 abhaycodes07 C Oct. 22, 2023, 8:34 a.m. OK Python 3 TESTS 14 1762 63180800
229359437 humblebose C Oct. 23, 2023, 1:56 a.m. OK Python 3 TESTS 14 2558 46899200
229203062 re-wa-tl-ok C Oct. 22, 2023, 10:57 a.m. OK Python 3 TESTS 14 2636 43827200

remove filters

Back to search problems