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 |
|---|---|---|---|---|---|---|
| 2248 | Codeforces Round 1113 (Div. 2) | FINISHED | False | 9000 | 2647470 | Aug. 1, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 491 ) | F | Matrix Elimination | PROGRAMMING | binary search math |
You are given an integer (k) and a matrix (v) with (n) rows and (m) columns. The element in row (i) and column (j) is denoted by (v_{i,j}). A cell ((x, y)) is called a peak if its value is greater than or equal to the sum of the values in all other cells in row (x) and column (y). Formally, ((x, y)) is a peak if () v_{x,y} \ge \sum_{\substack{1 \le i \le n \\i \neq x}} v_{i,y} + \sum_{\substack{1 \le j \le m \\j \neq y}} v_{x,j}. () You may perform the following operation any number of times (possibly zero): Choose four integers (x_l), (x_r), (y_l), and (y_r) ((1 \le x_l \le x_r \le n), (1 \le y_l \le y_r \le m)). Subtract (1) from (v_{i,j}) for every (x_l \le i \le x_r) and (y_l \le j \le y_r). Find the minimum number of operations required to obtain a matrix with at least (k) peaks. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains three integers (n), (m), and (k) ((1 \le n, m \le 10^5), (1 \le k \le n \cdot m), (n \cdot m \le 10^5)) — the number of rows, the number of columns, and the required number of peaks. The (i)-th of the next (n) lines contains (m) integers (v_{i,1}, v_{i,2}, \ldots, v_{i,m}) ((-10^9 \le v_{i,j} \le 10^9)). It is guaranteed that the sum of (n \cdot m) over all test cases does not exceed (10^5). For each test case, output a single integer — the minimum number of operations required to obtain at least (k) peaks. If there is no solution, print a single integer (-1). For the first test case, you can perform the following two operations: choose ((x_l, x_r, y_l, y_r) = (1, 3, 2, 3)); choose ((x_l, x_r, y_l, y_r) = (2, 3, 1, 3)). After these operations, the matrix will be: The seven peaks are highlighted in green. For ex |
| Codeforces Round 1113 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 385181964 | sronak | F | Aug. 1, 2026, 4:48 p.m. | OK | C# 13 | TESTS | 42 | 140 | 18329600 | ||
| 385182637 | alexlikemath007 | F | Aug. 1, 2026, 4:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 62 | 102400 | ||
| 385325363 | therealdoug0986 | F | Aug. 2, 2026, 10:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 78 | 102400 | ||
| 385184752 | mncuchiinhuttt | F | Aug. 1, 2026, 4:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 78 | 1331200 | ||
| 385336595 | MCPlayer542 | F | Aug. 3, 2026, 2:40 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 78 | 3686400 | ||
| 385179800 | Ehundategh | F | Aug. 1, 2026, 4:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 78 | 3686400 | ||
| 385224816 | hmm789 | F | Aug. 2, 2026, 4:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 93 | 921600 | ||
| 385180909 | dusankovacevic.329 | F | Aug. 1, 2026, 4:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 93 | 1433600 | ||
| 385286068 | woyaobianshengle | F | Aug. 2, 2026, 2:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 93 | 1740800 | ||
| 385352458 | Ashfarfaizi2324 | F | Aug. 3, 2026, 5:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 93 | 2150400 | ||
| 385181356 | shi255 | F | Aug. 1, 2026, 4:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 42 | 93 | 2150400 | ||
| 385227588 | cat_and_code | F | Aug. 2, 2026, 5:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 102400 | ||
| 385200080 | akua | F | Aug. 1, 2026, 7:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 1945600 | ||
| 385220672 | Splashing | F | Aug. 2, 2026, 3:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 3276800 | ||
| 385309789 | anujjoshi09jo | F | Aug. 2, 2026, 5:55 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 4096000 | ||
| 385181309 | AlRntn | F | Aug. 1, 2026, 4:46 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 62 | 4300800 | ||
| 385186114 | DSG213 | F | Aug. 1, 2026, 5:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 78 | 819200 | ||
| 385182733 | sbsb114 | F | Aug. 1, 2026, 4:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 78 | 1433600 | ||
| 385193644 | mwen | F | Aug. 1, 2026, 6:06 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 78 | 1843200 | ||
| 385194390 | mwen | F | Aug. 1, 2026, 6:12 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 78 | 1945600 | ||
| 385193569 | mwen | F | Aug. 1, 2026, 6:06 p.m. | OK | C++20 (GCC 13-64) | TESTS | 42 | 78 | 1945600 | ||
| 385214985 | Dalek_of_Rivia | F | Aug. 1, 2026, 11:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 0 | ||
| 385180391 | jaloliddinovzuhriddin | F | Aug. 1, 2026, 4:43 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 0 | ||
| 385184818 | m3e92 | F | Aug. 1, 2026, 4:58 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 102400 | ||
| 385183900 | _Gawd_ | F | Aug. 1, 2026, 4:55 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 102400 | ||
| 385246932 | testingdududu | F | Aug. 2, 2026, 8:09 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 204800 | ||
| 385235074 | nguyentuanxl | F | Aug. 2, 2026, 6:30 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 204800 | ||
| 385185366 | DreamChaser | F | Aug. 1, 2026, 5 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 204800 | ||
| 385324500 | Cyber | F | Aug. 2, 2026, 9:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 1126400 | ||
| 385215645 | juliurius | F | Aug. 2, 2026, 12:28 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 1740800 | ||
| 385269848 | kv4yne | F | Aug. 2, 2026, 11:46 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 42 | 62 | 1945600 | ||
| 385186111 | Shobhit_008 | F | Aug. 1, 2026, 5:02 p.m. | OK | GNU C11 | TESTS | 42 | 62 | 2355200 | ||
| 385184488 | Avi070 | F | Aug. 1, 2026, 4:57 p.m. | OK | GNU C11 | TESTS | 42 | 62 | 5120000 | ||
| 385183334 | champion2049 | F | Aug. 1, 2026, 4:53 p.m. | OK | Java 21 | TESTS | 42 | 234 | 409600 | ||
| 385275945 | C0NQU3R0R | F | Aug. 2, 2026, 12:47 p.m. | OK | PyPy 3 | TESTS | 42 | 906 | 17920000 | ||
| 385270356 | Snowfire | F | Aug. 2, 2026, 11:50 a.m. | OK | PyPy 3-64 | TESTS | 42 | 218 | 18944000 | ||
| 385191406 | EliteCoder_77 | F | Aug. 1, 2026, 5:47 p.m. | OK | PyPy 3-64 | TESTS | 42 | 234 | 18534400 | ||
| 385281514 | rajeev948 | F | Aug. 2, 2026, 1:40 p.m. | OK | PyPy 3-64 | TESTS | 42 | 453 | 18739200 | ||
| 385179216 | znej | F | Aug. 1, 2026, 4:38 p.m. | OK | PyPy 3-64 | TESTS | 42 | 546 | 18739200 | ||
| 385289352 | Ahmed_Faraj | F | Aug. 2, 2026, 2:54 p.m. | OK | PyPy 3-64 | TESTS | 42 | 546 | 25088000 | ||
| 385236034 | Untitled_geek | F | Aug. 2, 2026, 6:39 a.m. | OK | PyPy 3-64 | TESTS | 42 | 546 | 25088000 | ||
| 385343454 | dumb_god | F | Aug. 3, 2026, 4:01 a.m. | OK | PyPy 3-64 | TESTS | 42 | 562 | 25190400 | ||
| 385189039 | ytfish | F | Aug. 1, 2026, 5:28 p.m. | OK | PyPy 3-64 | TESTS | 42 | 640 | 26419200 | ||
| 385218154 | x0rque | F | Aug. 2, 2026, 2:01 a.m. | OK | PyPy 3-64 | TESTS | 42 | 671 | 19660800 | ||
| 385180199 | elementus0312 | F | Aug. 1, 2026, 4:42 p.m. | OK | PyPy 3-64 | TESTS | 42 | 750 | 19968000 | ||
| 385185464 | wanglupku | F | Aug. 1, 2026, 5 p.m. | OK | Python 3 | TESTS | 42 | 281 | 24576000 | ||
| 385232946 | Tryent | F | Aug. 2, 2026, 6:11 a.m. | OK | Python 3 | TESTS | 42 | 500 | 25292800 | ||
| 385178891 | playsapex79 | F | Aug. 1, 2026, 4:37 p.m. | OK | Python 3 | TESTS | 42 | 1515 | 18944000 | ||
| 385195190 | pigsoft.g | F | Aug. 1, 2026, 6:19 p.m. | OK | Rust 2024 | TESTS | 42 | 46 | 4710400 | ||
| 385199090 | cvs-650 | F | Aug. 1, 2026, 6:59 p.m. | OK | Rust 2024 | TESTS | 42 | 62 | 5427200 |
Back to search problems