Codeforces Round 872 (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
1825 Codeforces Round 872 (Div. 2) FINISHED False 7200 48275699 May 8, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14775 ) B LuoTianyi and the Table PROGRAMMING greedy math 1000

B"LuoTianyi gave an array b of n cdot m integers. She asks you to construct a table a of size n x m , filled with these n cdot m numbers, and each element of the array must be used exactly once. Also she asked you to maximize the following value: This means that we consider n cdot m subtables with the upper left corner in (1,1) and the bottom right corner in (i, j) ( 1 <= i <= n , 1 <= j <= m ), for each such subtable calculate the difference of the maximum and minimum elements in it, then sum up all these differences. You should maximize the resulting sum. Help her find the maximal possible value, you don't need to reconstruct the table itself. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 200 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n and m ( 2 <= n, m <= 100 ) -- the number of rows and columns of the table. The second line of each test case contains n cdot m integers b_1, b_2, ldots, b_{n cdot m} ( -10^5 <= b_{i} <= 10^5 ) -- the numbers you can put in the table. Note, that integers in the array b can be negative. It is guaranteed that the sum of n cdot m over all test cases doesn't exceed 2 cdot 10^5 . For each test case, output a single integer -- the maximal value, that can be obtained. In the first test case, the table is follows: 4113 In the subtable with the bottom right corner in (1, 1) , the difference of the maximal and minimal elements is 4 - 4 = 0 . In the subtable with the bottom right corner in (1, 2) , the difference of the maximal and minimal elements is 4 - 1 = 3 . In the subtable with the bottom right corner in (2, 1) , the difference of the maximal and minimal elements is 4 - 1 = 3 . In the subtable with the bottom right corner in (2"...

Tutorials

CodeForces Round 872(Div. 1&2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
206454187 ayoub_dkhissi B May 19, 2023, 1:55 p.m. OK C# 10 TESTS 15 124 9830400 1000
206407876 Samyo B May 19, 2023, 5:50 a.m. OK Clang++17 Diagnostics TESTS 15 187 0 1000
205315679 2000030103 B May 10, 2023, 10:42 a.m. OK Clang++17 Diagnostics TESTS 15 826 1024000 1000
205279170 decade_66 B May 10, 2023, 1:25 a.m. OK Clang++20 Diagnostics TESTS 15 78 0 1000
205236878 vjudge3 B May 9, 2023, 2:24 p.m. OK Clang++20 Diagnostics TESTS 15 171 0 1000
206408160 vjudge2 B May 19, 2023, 5:54 a.m. OK Clang++20 Diagnostics TESTS 15 171 0 1000
205827295 sofiazy B May 14, 2023, 11:44 a.m. OK Clang++20 Diagnostics TESTS 15 187 512000 1000
206408079 Samyo B May 19, 2023, 5:52 a.m. OK Clang++20 Diagnostics TESTS 15 202 0 1000
205827165 sofiazy B May 14, 2023, 11:43 a.m. OK Clang++20 Diagnostics TESTS 15 639 9932800 1000
205231256 estars B May 9, 2023, 1:35 p.m. OK Clang++20 Diagnostics TESTS 15 810 4300800 1000
205241740 ysail B May 9, 2023, 3:08 p.m. OK Clang++20 Diagnostics TESTS 15 873 102400 1000
205827399 sofiazy B May 14, 2023, 11:45 a.m. OK Clang++20 Diagnostics TESTS 15 873 512000 1000
205243845 zaogaijieshu B May 9, 2023, 3:26 p.m. OK Clang++20 Diagnostics TESTS 15 888 819200 1000
205252201 Aneeba B May 9, 2023, 4:41 p.m. OK GNU C11 TESTS 15 46 0 1000
206407933 Seriously_Its_Sameer B May 19, 2023, 5:51 a.m. OK GNU C11 TESTS 15 62 0 1000
205405732 paramparsewar B May 11, 2023, 8:42 a.m. OK GNU C11 TESTS 15 62 102400 1000
206227641 astronom1cal B May 17, 2023, 3:18 p.m. OK GNU C11 TESTS 15 62 102400 1000
205693372 clc26765 B May 13, 2023, 8:38 a.m. OK GNU C11 TESTS 15 78 0 1000
205245816 kehuanenrong B May 9, 2023, 3:44 p.m. OK GNU C11 TESTS 15 78 1638400 1000
205245002 kehuanenrong B May 9, 2023, 3:36 p.m. OK GNU C11 TESTS 15 78 1638400 1000
205224691 wilson111.. B May 9, 2023, 12:40 p.m. OK GNU C11 TESTS 15 218 0 1000
205212895 c1120231020 B May 9, 2023, 10:53 a.m. OK GNU C++14 TESTS 15 31 6144000 1000
205825135 Pilgrims B May 14, 2023, 11:17 a.m. OK GNU C++14 TESTS 15 46 0 1000
205325292 YOUR-SUN B May 10, 2023, 12:21 p.m. OK GNU C++14 TESTS 15 46 0 1000
205186593 DGME B May 9, 2023, 5:38 a.m. OK GNU C++14 TESTS 15 46 102400 1000
205180747 SmuggingSpon B May 9, 2023, 3:44 a.m. OK GNU C++14 TESTS 15 46 307200 1000
205191555 king20090712 B May 9, 2023, 6:52 a.m. OK GNU C++14 TESTS 15 46 819200 1000
206288900 Mr_White_ B May 18, 2023, 1:36 a.m. OK GNU C++14 TESTS 15 46 819200 1000
205697718 nightyao0510 B May 13, 2023, 9:14 a.m. OK GNU C++14 TESTS 15 61 0 1000
205187769 pratik1603 B May 9, 2023, 5:58 a.m. OK GNU C++14 TESTS 15 61 102400 1000
205275178 kirolosadel02 B May 9, 2023, 10:52 p.m. OK GNU C++14 TESTS 15 61 307200 1000
205668588 MarbIue B May 13, 2023, 4:38 a.m. OK GNU C++17 TESTS 15 31 2662400 1000
206100837 sarthak_nik B May 16, 2023, 2:40 p.m. OK GNU C++17 TESTS 15 46 0 1000
205228995 Pratham2907 B May 9, 2023, 1:15 p.m. OK GNU C++17 TESTS 15 46 0 1000
205669812 zgw B May 13, 2023, 4:55 a.m. OK GNU C++17 TESTS 15 46 0 1000
206087572 joy.chan.yx B May 16, 2023, 12:40 p.m. OK GNU C++17 TESTS 15 46 102400 1000
205179810 ohshtt B May 9, 2023, 3:23 a.m. OK GNU C++17 TESTS 15 46 102400 1000
205935397 syntaxSavior B May 15, 2023, 2:56 a.m. OK GNU C++17 TESTS 15 46 102400 1000
205753720 Novi1024 B May 13, 2023, 6:23 p.m. OK GNU C++17 TESTS 15 46 204800 1000
205326907 sohag7th B May 10, 2023, 12:37 p.m. OK GNU C++17 TESTS 15 46 307200 1000
205383749 Suriel B May 11, 2023, 3:06 a.m. OK GNU C++17 TESTS 15 46 307200 1000
205514631 KivenKill B May 12, 2023, 8:34 a.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206573011 OTTFF B May 19, 2023, 10:18 p.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206402816 GudeGude B May 19, 2023, 4:25 a.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206346657 SyruLoveNewTechnology B May 18, 2023, 1:38 p.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206339615 Mahmoud_Alaaraj B May 18, 2023, 12:31 p.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206089398 ieeqwq B May 16, 2023, 12:55 p.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206089372 ieeqwq B May 16, 2023, 12:55 p.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206076800 lrXac B May 16, 2023, 10:59 a.m. OK GNU C++17 (64) TESTS 15 46 0 1000
206042431 guptaaditya30121 B May 16, 2023, 3:27 a.m. OK GNU C++17 (64) TESTS 15 46 0 1000
205405301 s8x B May 11, 2023, 8:37 a.m. OK GNU C++17 (64) TESTS 15 46 0 1000
205726386 shyam_saktawat B May 13, 2023, 1:54 p.m. OK GNU C++20 (64) TESTS 15 30 135270400 1000
205225373 Adam_GS B May 9, 2023, 12:45 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205256539 alexk07 B May 9, 2023, 5:28 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205452543 ykpcx B May 11, 2023, 3:58 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205505942 black_roses B May 12, 2023, 6:46 a.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205717123 SteppeNomad B May 13, 2023, 12:27 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205732024 Rojan..k B May 13, 2023, 2:51 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205777847 yibigouxiao B May 14, 2023, 2:52 a.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205836195 vladilius B May 14, 2023, 1:19 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205238017 Tasmi_Khair B May 9, 2023, 2:34 p.m. OK GNU C++20 (64) TESTS 15 31 0 1000
205221699 gaju_01 B May 9, 2023, 12:15 p.m. OK Java 11 TESTS 15 202 0 1000
205251190 pimonster B May 9, 2023, 4:31 p.m. OK Java 11 TESTS 15 217 0 1000
205545079 aadarsh_singh B May 12, 2023, 2:01 p.m. OK Java 11 TESTS 15 218 0 1000
205499181 kimbro B May 12, 2023, 5:13 a.m. OK Java 11 TESTS 15 218 0 1000
205471257 TheGoldenSmileOfTheNile B May 11, 2023, 7:11 p.m. OK Java 11 TESTS 15 233 0 1000
205332194 maverick_1729 B May 10, 2023, 1:25 p.m. OK Java 11 TESTS 15 233 40345600 1000
205281654 NithinBharathi B May 10, 2023, 2:37 a.m. OK Java 11 TESTS 15 249 0 1000
205240087 deepakanto B May 9, 2023, 2:53 p.m. OK Java 11 TESTS 15 249 0 1000
205701550 amanpatel23 B May 13, 2023, 9:52 a.m. OK Java 11 TESTS 15 265 0 1000
205240465 vishal_sahu B May 9, 2023, 2:56 p.m. OK Java 11 TESTS 15 280 0 1000
206418036 jimmyd211 B May 19, 2023, 7:52 a.m. OK Java 17 TESTS 15 186 614400 1000
205197120 humwawe B May 9, 2023, 8:04 a.m. OK Java 17 TESTS 15 187 204800 1000
206139753 Vrutik_2809 B May 16, 2023, 5:32 p.m. OK Java 17 TESTS 15 202 614400 1000
205528837 bleach__ B May 12, 2023, 11:26 a.m. OK Java 17 TESTS 15 248 512000 1000
206191186 dracarys_1105 B May 17, 2023, 9:27 a.m. OK Java 17 TESTS 15 249 204800 1000
206396862 mcrash12 B May 19, 2023, 2:26 a.m. OK Java 17 TESTS 15 249 307200 1000
205676413 aquafrost16 B May 13, 2023, 6:09 a.m. OK Java 17 TESTS 15 249 614400 1000
205487477 aruniscoding B May 12, 2023, 1:09 a.m. OK Java 17 TESTS 15 249 819200 1000
205441700 _lwq_123_ B May 11, 2023, 2:21 p.m. OK Java 17 TESTS 15 265 512000 1000
205946236 Suraj1607 B May 15, 2023, 6:07 a.m. OK Java 17 TESTS 15 265 716800 1000
205935097 Camellia- B May 15, 2023, 2:49 a.m. OK Java 8 TESTS 15 124 0 1000
205323986 onenewbie B May 10, 2023, 12:09 p.m. OK Java 8 TESTS 15 140 0 1000
205188792 Saurabh-Sharma B May 9, 2023, 6:13 a.m. OK Java 8 TESTS 15 140 0 1000
206376741 vaibhav_1710 B May 18, 2023, 6:29 p.m. OK Java 8 TESTS 15 171 0 1000
206046787 madhav2800 B May 16, 2023, 4:52 a.m. OK Java 8 TESTS 15 171 0 1000
205468608 1091857051 B May 11, 2023, 6:40 p.m. OK Java 8 TESTS 15 171 0 1000
205461980 ahmedTarek28 B May 11, 2023, 5:33 p.m. OK Java 8 TESTS 15 171 0 1000
205790122 Tim2004 B May 14, 2023, 6:09 a.m. OK Java 8 TESTS 15 187 0 1000
205350135 lpychemistry B May 10, 2023, 4:16 p.m. OK Java 8 TESTS 15 187 0 1000
205312061 danielaggarwal B May 10, 2023, 9:56 a.m. OK Java 8 TESTS 15 187 0 1000
205419030 SlavaG B May 11, 2023, 11:02 a.m. OK Kotlin 1.7 TESTS 15 732 52428800 1000
206204071 wdploveacm B May 17, 2023, 11:39 a.m. OK MS C++ 2017 TESTS 15 62 0 1000
205338963 Dick007 B May 10, 2023, 2:24 p.m. OK MS C++ 2017 TESTS 15 171 102400 1000
205180326 ShlumBerg B May 9, 2023, 3:34 a.m. OK MS C++ 2017 TESTS 15 171 102400 1000
205330445 _2dvector B May 10, 2023, 1:09 p.m. OK MS C++ 2017 TESTS 15 171 819200 1000
205845255 nimalegebi B May 14, 2023, 2:38 p.m. OK MS C++ 2017 TESTS 15 202 102400 1000
205372577 Darooha B May 10, 2023, 9:33 p.m. OK Ocaml TESTS 15 156 716800 1000
205521727 Ysb04 B May 12, 2023, 9:58 a.m. OK PyPy 3 TESTS 15 217 9523200 1000
206138326 anupam_sudh B May 16, 2023, 5:19 p.m. OK PyPy 3 TESTS 15 217 9728000 1000
205524318 takshaheryar B May 12, 2023, 10:31 a.m. OK PyPy 3 TESTS 15 218 9728000 1000
205907368 momenelmesady4803 B May 14, 2023, 5:52 p.m. OK PyPy 3 TESTS 15 233 9625600 1000
205795886 lol_py B May 14, 2023, 7 a.m. OK PyPy 3 TESTS 15 233 9625600 1000
206319853 soudhamini_2000031088 B May 18, 2023, 9:25 a.m. OK PyPy 3 TESTS 15 233 9728000 1000
205787044 whoami096 B May 14, 2023, 5:34 a.m. OK PyPy 3 TESTS 15 233 9728000 1000
205348820 jvatsal0709 B May 10, 2023, 4:03 p.m. OK PyPy 3 TESTS 15 233 9728000 1000
205255494 Pirogoff B May 9, 2023, 5:17 p.m. OK PyPy 3 TESTS 15 234 9625600 1000
205343746 arpan.parikh B May 10, 2023, 3:10 p.m. OK PyPy 3 TESTS 15 248 74649600 1000
205241793 Severian B May 9, 2023, 3:08 p.m. OK PyPy 3-64 TESTS 15 92 9932800 1000
205263310 alexocode B May 9, 2023, 6:45 p.m. OK PyPy 3-64 TESTS 15 93 9523200 1000
205198419 reijnnn B May 9, 2023, 8:20 a.m. OK PyPy 3-64 TESTS 15 93 9830400 1000
206570929 tommyalbert899 B May 19, 2023, 9:22 p.m. OK PyPy 3-64 TESTS 15 93 10035200 1000
205382452 fclvbfm934 B May 11, 2023, 2:33 a.m. OK PyPy 3-64 TESTS 15 93 10137600 1000
205274862 3laa3adel_13 B May 9, 2023, 10:42 p.m. OK PyPy 3-64 TESTS 15 93 10137600 1000
205286991 anton57 B May 10, 2023, 4:28 a.m. OK PyPy 3-64 TESTS 15 93 10752000 1000
205219944 Arsenic_05 B May 9, 2023, noon OK PyPy 3-64 TESTS 15 108 9932800 1000
206276326 pp_in B May 17, 2023, 7:23 p.m. OK PyPy 3-64 TESTS 15 108 10035200 1000
205436860 ElizabethJay B May 11, 2023, 1:40 p.m. OK PyPy 3-64 TESTS 15 108 10035200 1000
205390214 bodrov247 B May 11, 2023, 5:19 a.m. OK Python 3 TESTS 15 77 1843200 1000
206013674 Wild_Bebra B May 15, 2023, 5:21 p.m. OK Python 3 TESTS 15 93 1536000 1000
205298103 pennymagic156 B May 10, 2023, 7:09 a.m. OK Python 3 TESTS 15 93 1638400 1000
205540752 ameysh123 B May 12, 2023, 1:21 p.m. OK Python 3 TESTS 15 93 1843200 1000
205261823 dragonball_2002 B May 9, 2023, 6:26 p.m. OK Python 3 TESTS 15 93 1843200 1000
205238883 jrjay B May 9, 2023, 2:42 p.m. OK Python 3 TESTS 15 93 1843200 1000
205205438 PhysicsBoyAC B May 9, 2023, 9:34 a.m. OK Python 3 TESTS 15 93 1843200 1000
206366181 alex2007051 B May 18, 2023, 4:40 p.m. OK Python 3 TESTS 15 93 1945600 1000
206018806 sridharsiddi B May 15, 2023, 6:18 p.m. OK Python 3 TESTS 15 93 1945600 1000
206011222 srinija_chowdary9 B May 15, 2023, 4:56 p.m. OK Python 3 TESTS 15 93 1945600 1000
206281397 julykanyk Julia140 phonk42 B May 17, 2023, 9:08 p.m. OK Ruby 3 TESTS 15 421 4198400 1000
206335692 DeadFox B May 18, 2023, 11:57 a.m. OK Rust 2021 TESTS 15 31 307200 1000
206081670 robostac B May 16, 2023, 11:48 a.m. OK Rust 2021 TESTS 15 31 307200 1000
205276319 avnyu B May 9, 2023, 11:34 p.m. OK Rust 2021 TESTS 15 31 307200 1000
205199449 ilyshana B May 9, 2023, 8:33 a.m. OK Rust 2021 TESTS 15 31 307200 1000
205188631 kshitij B May 9, 2023, 6:11 a.m. OK Rust 2021 TESTS 15 31 921600 1000
205273617 kost B May 9, 2023, 10:05 p.m. OK Rust 2021 TESTS 15 46 1024000 1000

remove filters

Back to search problems