Codeforces Round 1075 (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
2189 Codeforces Round 1075 (Div. 2) FINISHED False 7200 7226723 Jan. 23, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 24218 ) A Table with Numbers PROGRAMMING greedy implementation

Peter drew a table of size (h \times l), filled with zeros. We will number its rows from (1) to (h) from top to bottom, and columns from (1) to (l) from left to right. Ned came up with an array of numbers (a_1, a_2, \ldots, a_n) and wanted to modify the table. Ned can choose (2k \leq n) numbers from his array and split them into (k) pairs. After that, for each resulting pair (x, y), he takes the cell located in row (x) and column (y), and adds (1) to the number in that cell. If such a cell does not exist, then this pair does nothing to the table. Peter supported Ned's initiative and asked him to maximize the sum of the numbers in the table. Help Ned understand what the maximum sum he can achieve is. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The first line of each test case contains three integers (n), (h), and (l) ((2 \le n \le 100), (1 \le h, l \le 1000)) — the size of the array, the height of the table, and the width of the table, respectively. The second line of each test case contains (n) numbers (a_1), (a_2), (\ldots), (a_n) ((1 \le a_i \le 1000)) — the array itself. For each test case, output the maximum possible sum of the numbers in the table. In the first test case, Ned can take the pair ((1, 1)) and add (1) to the number located in row (1) and column (1). In the second test case, Ned can take the numbers (1, 2, 2, 2) and pair them as follows: ((1, 2), (2, 2)). Then, in two cells of the table, there will be a (1), and the sum will be equal to (2). It can be shown that it is not possible to achieve a higher sum. In the fifth test case, the only pair that Ned can take is ((5, 5)). Since such a cell does not exist in the table, the sum of the numbers in the table cannot exceed (0). In the seventh tes

Tutorials

Codeforces Round 1075 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359467280 Desh2 A Jan. 23, 2026, 7:20 p.m. OK C# 13 TESTS 4 78 2662400
359487268 zhangpz A Jan. 24, 2026, 2:28 a.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359471581 omkrishna11 A Jan. 23, 2026, 8:09 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359465597 Sasank123 A Jan. 23, 2026, 7:03 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359465024 akshat100 A Jan. 23, 2026, 6:57 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359462093 Himanshu_Nainwal A Jan. 23, 2026, 6:31 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359459576 ssabarinath293 A Jan. 23, 2026, 6:13 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359458673 ragzog_kv A Jan. 23, 2026, 6:06 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359458496 zdumb A Jan. 23, 2026, 6:05 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359456567 ItzShuvrodip A Jan. 23, 2026, 5:51 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359450392 TheCodeWhiz A Jan. 23, 2026, 5:11 p.m. OK C++17 (GCC 7-32) TESTS 4 15 0
359499041 velocity___09 A Jan. 24, 2026, 5:21 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359493203 Rajesh_2304 A Jan. 24, 2026, 4:16 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359489629 shaman. A Jan. 24, 2026, 3:12 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359484453 LuYuX A Jan. 24, 2026, 1:15 a.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359479503 marthiPp A Jan. 23, 2026, 10:33 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359472062 Yassooooo A Jan. 23, 2026, 8:15 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359466326 aadit59 A Jan. 23, 2026, 7:11 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359464602 TitanAnupam A Jan. 23, 2026, 6:53 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359464403 PipRa A Jan. 23, 2026, 6:51 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359455534 ImNJ A Jan. 23, 2026, 5:43 p.m. OK C++20 (GCC 13-64) TESTS 4 15 0
359504749 ankushbalse87 A Jan. 24, 2026, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359504448 sun_river A Jan. 24, 2026, 6:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359502927 Lhohelhohehmm A Jan. 24, 2026, 5:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359501862 masteroojway A Jan. 24, 2026, 5:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359501819 Akshansh86 A Jan. 24, 2026, 5:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359501646 prashant81556 A Jan. 24, 2026, 5:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359495410 Khushal_Midha A Jan. 24, 2026, 4:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359494763 what_to_do A Jan. 24, 2026, 4:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359493793 santoshkumarpatra084000 A Jan. 24, 2026, 4:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359493534 Logic_Forge19 A Jan. 24, 2026, 4:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 15 0
359501866 2510976107reinhard A Jan. 24, 2026, 5:43 a.m. OK GNU C11 TESTS 4 15 0
359463456 gabrielsg A Jan. 23, 2026, 6:43 p.m. OK GNU C11 TESTS 4 15 0
359463129 aimanesaber A Jan. 23, 2026, 6:40 p.m. OK GNU C11 TESTS 4 15 0
359458045 vipinrawat9119 A Jan. 23, 2026, 6:02 p.m. OK GNU C11 TESTS 4 15 0
359443449 srikar07 A Jan. 23, 2026, 4:30 p.m. OK GNU C11 TESTS 4 15 0
359440875 Lavangam A Jan. 23, 2026, 4:26 p.m. OK GNU C11 TESTS 4 15 0
359504393 Bharad1000 A Jan. 24, 2026, 6:01 a.m. OK GNU C11 TESTS 4 15 102400
359452242 Dape07 A Jan. 23, 2026, 5:21 p.m. OK GNU C11 TESTS 4 15 102400
359466705 Fardinkhanfahmi A Jan. 23, 2026, 7:15 p.m. OK GNU C11 TESTS 4 31 0
359449726 Helo26160324 A Jan. 23, 2026, 5:08 p.m. OK GNU C11 TESTS 4 31 0
359501512 saanikaa A Jan. 24, 2026, 5:41 a.m. OK Java 21 TESTS 4 171 0
359456448 Anmol_ZEZX A Jan. 23, 2026, 5:50 p.m. OK Java 21 TESTS 4 171 0
359444254 anitusiruk A Jan. 23, 2026, 4:31 p.m. OK Java 21 TESTS 4 171 0
359479423 Madhan_Kumar26291 A Jan. 23, 2026, 10:31 p.m. OK Java 21 TESTS 4 171 204800
359492641 2251307025 A Jan. 24, 2026, 4:07 a.m. OK Java 21 TESTS 4 187 512000
359474490 NanDemo A Jan. 23, 2026, 8:50 p.m. OK Java 21 TESTS 4 187 716800
359502580 GODAJM A Jan. 24, 2026, 5:48 a.m. OK Java 21 TESTS 4 203 0
359485182 sathwikhbhat A Jan. 24, 2026, 1:34 a.m. OK Java 21 TESTS 4 203 0
359500050 GuLLu05 A Jan. 24, 2026, 5:29 a.m. OK Java 21 TESTS 4 203 102400
359467396 Trailblazer108 A Jan. 23, 2026, 7:22 p.m. OK Java 21 TESTS 4 203 102400
359496781 d_aggarwal A Jan. 24, 2026, 5:01 a.m. OK Java 8 TESTS 4 78 0
359463263 lusifer97 A Jan. 23, 2026, 6:41 p.m. OK Java 8 TESTS 4 93 0
359469244 public-static-void-main A Jan. 23, 2026, 7:41 p.m. OK Java 8 TESTS 4 109 17100800
359497022 jash.rashne A Jan. 24, 2026, 5:03 a.m. OK Java 8 TESTS 4 140 0
359496604 abhishek1445 A Jan. 24, 2026, 4:59 a.m. OK Java 8 TESTS 4 140 0
359459898 VikrantYadav2005 A Jan. 23, 2026, 6:15 p.m. OK Java 8 TESTS 4 156 0
359441832 varsDivya A Jan. 23, 2026, 4:27 p.m. OK Java 8 TESTS 4 156 0
359440313 AmgothVikram A Jan. 23, 2026, 4:25 p.m. OK Java 8 TESTS 4 156 0
359495138 javeed_123 A Jan. 24, 2026, 4:43 a.m. OK Java 8 TESTS 4 171 0
359467188 abhishekcloud2003 A Jan. 23, 2026, 7:19 p.m. OK Java 8 TESTS 4 171 0
359479123 tin.le2 A Jan. 23, 2026, 10:22 p.m. OK Kotlin 1.7 TESTS 4 312 6963200
359469770 tpsmacho A Jan. 23, 2026, 7:48 p.m. OK Node.js TESTS 4 78 7168000
359465100 Omorisdead A Jan. 23, 2026, 6:58 p.m. OK PyPy 3 TESTS 4 109 5836800
359487979 harshitha_09 A Jan. 24, 2026, 2:43 a.m. OK PyPy 3 TESTS 4 125 3072000
359465522 Alpha_Tri0n A Jan. 23, 2026, 7:02 p.m. OK PyPy 3 TESTS 4 125 5120000
359455307 Aroson A Jan. 23, 2026, 5:41 p.m. OK PyPy 3 TESTS 4 140 3584000
359445583 ujjwaladitya01 A Jan. 23, 2026, 4:33 p.m. OK PyPy 3 TESTS 4 203 5836800
359476786 ggyongyi A Jan. 23, 2026, 9:32 p.m. OK PyPy 3-64 TESTS 4 62 2355200
359475215 masao A Jan. 23, 2026, 9:02 p.m. OK PyPy 3-64 TESTS 4 62 2764800
359496994 Black_Lung_Morgan A Jan. 24, 2026, 5:03 a.m. OK PyPy 3-64 TESTS 4 62 3072000
359481760 OAY71011 A Jan. 23, 2026, 11:46 p.m. OK PyPy 3-64 TESTS 4 62 3072000
359440431 vignesh.ph10 A Jan. 23, 2026, 4:25 p.m. OK PyPy 3-64 TESTS 4 62 3072000
359445752 IcyGirl A Jan. 23, 2026, 4:33 p.m. OK PyPy 3-64 TESTS 4 62 3379200
359470274 yoshikawa_yuki A Jan. 23, 2026, 7:54 p.m. OK PyPy 3-64 TESTS 4 62 3686400
359495167 Sayanth_19 A Jan. 24, 2026, 4:44 a.m. OK PyPy 3-64 TESTS 4 62 4915200
359493781 sharmaujjwal5706 A Jan. 24, 2026, 4:25 a.m. OK PyPy 3-64 TESTS 4 62 5017600
359450222 Amogh_Gajera A Jan. 23, 2026, 5:10 p.m. OK PyPy 3-64 TESTS 4 62 5222400
359458872 Srimanmiryala A Jan. 23, 2026, 6:08 p.m. OK Python 3 TESTS 4 31 3481600
359492642 kunal_13 A Jan. 24, 2026, 4:07 a.m. OK Python 3 TESTS 4 46 0
359441677 sanixxxx A Jan. 23, 2026, 4:27 p.m. OK Python 3 TESTS 4 46 0
359457858 TempestArchon A Jan. 23, 2026, 6 p.m. OK Python 3 TESTS 4 46 102400
359452294 AmitGupta225 A Jan. 23, 2026, 5:22 p.m. OK Python 3 TESTS 4 46 102400
359446546 Anisha_2702 A Jan. 23, 2026, 4:34 p.m. OK Python 3 TESTS 4 46 102400
359440184 hemanth_08_ A Jan. 23, 2026, 4:25 p.m. OK Python 3 TESTS 4 46 102400
359439870 soui_malek A Jan. 23, 2026, 4:24 p.m. OK Python 3 TESTS 4 46 102400
359442560 NullNCoder A Jan. 23, 2026, 4:29 p.m. OK Python 3 TESTS 4 46 3379200
359483632 YoRu-ShiKa A Jan. 24, 2026, 12:50 a.m. OK Python 3 TESTS 4 46 3481600
359459698 SlavaNixon A Jan. 23, 2026, 6:13 p.m. OK Ruby 3 TESTS 4 156 819200
359461635 SlavaNixon A Jan. 23, 2026, 6:27 p.m. OK Ruby 3 TESTS 4 203 409600
359492383 vanshit A Jan. 24, 2026, 4:03 a.m. OK Rust 2024 TESTS 4 31 0
359487773 StoneXie A Jan. 24, 2026, 2:38 a.m. OK Rust 2024 TESTS 4 31 0
359468008 Singu_Larity A Jan. 23, 2026, 7:27 p.m. OK Rust 2024 TESTS 4 31 0

remove filters

Back to search problems