Codeforces Round 1032 (Div. 3)

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
2121 Codeforces Round 1032 (Div. 3) FINISHED False 8100 26234723 June 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 21634 ) C Those Who Are With Us PROGRAMMING greedy greedy implementation

You are given a matrix of integers with (n) rows and (m) columns. The cell at the intersection of the (i)-th row and the (j)-th column contains the number (a_{ij}). You can perform the following operation exactly once : Choose two numbers (1 \leq r \leq n) and (1 \leq c \leq m). For all cells ((i, j)) in the matrix such that (i = r) or (j = c), decrease (a_{ij}) by one. You need to find the minimal possible maximum value in the matrix (a) after performing exactly one such operation. Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((1 \leq n \cdot m \leq 10^5)) — the number of rows and columns in the matrix. The next (n) lines of each test case describe the matrix (a). The (i)-th line contains (m) integers (a_{i1}, a_{i2}, \ldots, a_{im}) ((1 \leq a_{ij} \leq 100)) — the elements in the (i)-th row of the matrix. It is guaranteed that the sum of (n \cdot m) across all test cases does not exceed (2 \cdot 10^5). For each test case, output the minimum maximum value in the matrix (a) after performing exactly one operation. In the first three test cases, you can choose (r = 1) and (c = 1). In the fourth test case, you can choose (r = 1) and (c = 2). In the fifth test case, you can choose (r = 2) and (c = 3). In the sixth test case, you can choose (r = 3) and (c = 2).

Tutorials

Codeforces Round 1032 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324929284 og.kostya C June 17, 2025, 5:33 p.m. OK C# 13 TESTS 6 109 921600
324963057 chrisTris C June 18, 2025, 1:29 a.m. OK C# 13 TESTS 6 171 21196800
324941360 AhmadNedalll C June 17, 2025, 6:21 p.m. OK C++17 (GCC 7-32) TESTS 6 61 0
324937940 brv1760hanu C June 17, 2025, 5:50 p.m. OK C++17 (GCC 7-32) TESTS 6 61 102400
324976151 pnzrdlr17 C June 18, 2025, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 6 62 0
324946218 Rachit_19 C June 17, 2025, 7:13 p.m. OK C++17 (GCC 7-32) TESTS 6 62 102400
324962377 close_fish C June 18, 2025, 1:16 a.m. OK C++17 (GCC 7-32) TESTS 6 62 819200
324985047 velthryn C June 18, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 6 77 0
324984859 amineo0 C June 18, 2025, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 6 77 0
324984380 iec2024049 C June 18, 2025, 5:55 a.m. OK C++17 (GCC 7-32) TESTS 6 77 0
324979132 siddharth0714 C June 18, 2025, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 6 77 0
324975741 renegade1050 C June 18, 2025, 4:25 a.m. OK C++17 (GCC 7-32) TESTS 6 77 0
324956085 emaannhassan C June 17, 2025, 9:59 p.m. OK C++20 (GCC 13-64) TESTS 6 61 102400
324955800 _Aya_Youssefff_ C June 17, 2025, 9:52 p.m. OK C++20 (GCC 13-64) TESTS 6 61 102400
324976401 xzyg C June 18, 2025, 4:32 a.m. OK C++20 (GCC 13-64) TESTS 6 61 11366400
324973407 code_wit_da_man_0302_x C June 18, 2025, 3:58 a.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324965090 cleanser C June 18, 2025, 2:07 a.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324949427 hotash_ C June 17, 2025, 7:54 p.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324941266 lololollo C June 17, 2025, 6:20 p.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324926168 x998244353x C June 17, 2025, 5:11 p.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324923373 Alraaafi C June 17, 2025, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 6 62 0
324981122 sudhujoshi C June 18, 2025, 5:23 a.m. OK C++20 (GCC 13-64) TESTS 6 62 102400
324945347 Antumbra01 C June 17, 2025, 7:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 3174400
324970508 Ovi0.0 C June 18, 2025, 3:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
324970340 Alter_native C June 18, 2025, 3:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
324976580 rrohitsy0h0 C June 18, 2025, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 102400
324937938 AhmedElseyoufi C June 17, 2025, 5:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 102400
324928085 Muhammad_Tahasan_Yo_Yo C June 17, 2025, 5:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 102400
324978128 Coder_Aks C June 18, 2025, 4:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 1024000
324956157 -arwa- C June 17, 2025, 10:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 62 0
324955146 wojtekm4726 C June 17, 2025, 9:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 62 0
324946816 David_Ezzat C June 17, 2025, 7:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 62 0
324955087 realabrarzahin C June 17, 2025, 9:34 p.m. OK GNU C11 TESTS 6 77 819200
324939772 Ashraf_HC C June 17, 2025, 6:06 p.m. OK GNU C11 TESTS 6 77 1536000
324939305 Flaming_pheonex C June 17, 2025, 6:02 p.m. OK GNU C11 TESTS 6 77 1536000
324967821 bt55555 C June 18, 2025, 2:48 a.m. OK GNU C11 TESTS 6 77 1740800
324927499 Andrew_is_alive C June 17, 2025, 5:20 p.m. OK GNU C11 TESTS 6 93 2048000
324941173 Mr_Zero_0 C June 17, 2025, 6:19 p.m. OK GNU C11 TESTS 6 108 512000
324949871 redreoicy C June 17, 2025, 8 p.m. OK Java 21 TESTS 6 218 819200
324955960 sohxm2k C June 17, 2025, 9:56 p.m. OK Java 21 TESTS 6 234 1126400
324926341 raYRS2geSiiPYP4D C June 17, 2025, 5:12 p.m. OK Java 21 TESTS 6 265 409600
324984096 Kakarot_DB C June 18, 2025, 5:52 a.m. OK Java 21 TESTS 6 265 716800
324959148 chahaldarren C June 17, 2025, 11:46 p.m. OK Java 21 TESTS 6 265 5222400
324922233 Divine_Anii C June 17, 2025, 4:51 p.m. OK Java 21 TESTS 6 280 1536000
324973579 Mitul11 C June 18, 2025, 4 a.m. OK Java 21 TESTS 6 280 1638400
324960254 Himanshu_khare C June 18, 2025, 12:25 a.m. OK Java 21 TESTS 6 280 5017600
324974859 sulabhambule C June 18, 2025, 4:14 a.m. OK Java 21 TESTS 6 281 1024000
324920650 Irvinwop C June 17, 2025, 4:48 p.m. OK Java 21 TESTS 6 296 921600
324944684 navin.ganji C June 17, 2025, 6:55 p.m. OK Java 8 TESTS 6 171 0
324922585 Lyless C June 17, 2025, 4:52 p.m. OK Java 8 TESTS 6 187 0
324937647 Sumitsingh7 C June 17, 2025, 5:47 p.m. OK Java 8 TESTS 6 202 6860800
324924986 Dan1c C June 17, 2025, 5:03 p.m. OK Java 8 TESTS 6 281 6656000
324977453 NischayCodes C June 18, 2025, 4:44 a.m. OK Java 8 TESTS 6 281 17408000
324979005 jatin310 C June 18, 2025, 5 a.m. OK Java 8 TESTS 6 374 0
324938312 Baidiki C June 17, 2025, 5:53 p.m. OK Java 8 TESTS 6 374 0
324921230 srishtiagarwal892 C June 17, 2025, 4:49 p.m. OK Java 8 TESTS 6 374 0
324920442 aprataksh C June 17, 2025, 4:48 p.m. OK Java 8 TESTS 6 374 0
324969314 bt22cse036 C June 18, 2025, 3:08 a.m. OK Java 8 TESTS 6 390 0
324922075 anteksha99 C June 17, 2025, 4:49 p.m. OK PyPy 2 TESTS 6 343 15052800
324966772 kevin_kaslanna C June 18, 2025, 2:33 a.m. OK PyPy 3 TESTS 6 343 23244800
324973165 Dias1177 C June 18, 2025, 3:56 a.m. OK PyPy 3 TESTS 6 577 16486400
324920947 greypilgrim36 C June 17, 2025, 4:49 p.m. OK PyPy 3 TESTS 6 749 23552000
324982278 yiwangwuqian C June 18, 2025, 5:34 a.m. OK PyPy 3 TESTS 6 984 52736000
324978057 pionchan2024 C June 18, 2025, 4:50 a.m. OK PyPy 3-64 TESTS 6 140 25190400
324946120 lostcache C June 17, 2025, 7:12 p.m. OK PyPy 3-64 TESTS 6 156 26931200
324947488 gustavaman C June 17, 2025, 7:29 p.m. OK PyPy 3-64 TESTS 6 156 32665600
324924227 noirt C June 17, 2025, 4:59 p.m. OK PyPy 3-64 TESTS 6 202 19660800
324942542 gardengnome C June 17, 2025, 6:32 p.m. OK PyPy 3-64 TESTS 6 202 23654400
324951379 Umaro C June 17, 2025, 8:24 p.m. OK PyPy 3-64 TESTS 6 202 27648000
324951571 DarkTemplarDrop C June 17, 2025, 8:27 p.m. OK PyPy 3-64 TESTS 6 202 36147200
324964106 hxu10 C June 18, 2025, 1:49 a.m. OK PyPy 3-64 TESTS 6 217 22630400
324963426 mvkhanh C June 18, 2025, 1:36 a.m. OK PyPy 3-64 TESTS 6 218 26316800
324962801 Taymyr C June 18, 2025, 1:24 a.m. OK PyPy 3-64 TESTS 6 218 34611200
324923737 karrt04 C June 17, 2025, 4:56 p.m. OK Python 3 TESTS 6 187 8806400
324947250 Yousaf.Z C June 17, 2025, 7:26 p.m. OK Python 3 TESTS 6 217 20889600
324953201 eugalt C June 17, 2025, 8:54 p.m. OK Python 3 TESTS 6 217 20992000
324919871 phongnc C June 17, 2025, 4:48 p.m. OK Python 3 TESTS 6 217 22528000
324938486 KAMALASHKUMAARC C June 17, 2025, 5:54 p.m. OK Python 3 TESTS 6 218 14131200
324964768 eugalt C June 18, 2025, 2:01 a.m. OK Python 3 TESTS 6 218 20787200
324944498 eugalt C June 17, 2025, 6:52 p.m. OK Python 3 TESTS 6 218 21094400
324953662 eugalt C June 17, 2025, 9:03 p.m. OK Python 3 TESTS 6 234 21196800
324985135 aakriti.mehrotra C June 18, 2025, 6:02 a.m. OK Python 3 TESTS 6 234 23552000
324921294 kumartatikonda C June 17, 2025, 4:49 p.m. OK Python 3 TESTS 6 249 10956800

remove filters

Back to search problems