Good Bye 2024: 2025 is NEAR

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
2053 Good Bye 2024: 2025 is NEAR FINISHED False 10800 41009123 Dec. 28, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 946 ) F Earnest Matrix Complement PROGRAMMING data structures dp greedy implementation

Peter: Good news: My problem T311013 is approved! (\delta): I'm glad my computer had gone out of battery so that I wouldn't have participated in wyrqwq's round and gained a negative delta. Felix: thumbs_up The problem statement concerning a removed song! Aquawave: Do I mourn my Chemistry? E.Space: ahh? Trine: Bread. Iris: So why am I always testing problems? Time will pass, and we might meet again. Looking back at the past, everybody has lived the life they wanted. Aquawave has a matrix (A) of size (n\times m), whose elements can only be integers in the range (1, k), inclusive. In the matrix, some cells are already filled with an integer, while the rest are currently not filled, denoted by (-1). You are going to fill in all the unfilled places in (A). After that, let (c_{u,i}) be the number of occurrences of element (u) in the (i)-th row. Aquawave defines the beauty of the matrix as ()\sum_{u=1}^k \sum_{i=1}^{n-1} c_{u,i} \cdot c_{u,i+1}.() You have to find the maximum possible beauty of (A) after filling in the blanks optimally. The first line of input contains a single integer (t) ((1 \leq t \leq 2\cdot 10^4)) — the number of test cases. The description of test cases follows. The first line of each test case contains three integers (n), (m), and (k) ((2 \leq n \leq 2\cdot 10^5), (2 \leq m \leq 2\cdot 10^5), (n \cdot m \leq 6\cdot 10^5), (1 \leq k \leq n\cdot m)) — the number of rows and columns of the matrix (A), and the range of the integers in the matrix, respectively. Then (n) lines follow, the (i)-th line containing (m) integers (A_{i,1},A_{i,2},\ldots,A_{i,m}) ((1 \leq A_{i,j} \leq k) or (A_{i,j} = -1)) — the elements in (A). It is guaranteed that the sum of (n\cdot m) over all test cases does not exceed (6\cdot 10^5). For each test case, output a single integer — the maximum possible beauty. In the first test case, the mat

Tutorials

Good Bye 2024: 2025 is NEAR Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
298925540 TianyiWei F Dec. 29, 2024, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 37 124 11776000
298898070 mike286928 F Dec. 28, 2024, 6:59 p.m. OK C++17 (GCC 7-32) TESTS 37 139 11776000
298927031 Luzhuoyuan F Dec. 29, 2024, 6:02 a.m. OK C++17 (GCC 7-32) TESTS 37 187 13107200
298899008 potato167 F Dec. 28, 2024, 7:09 p.m. OK C++17 (GCC 7-32) TESTS 37 218 20582400
298890148 knightL F Dec. 28, 2024, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 37 233 13721600
298927311 TianyiWei F Dec. 29, 2024, 6:06 a.m. OK C++17 (GCC 7-32) TESTS 37 234 27955200
298883196 Gold14526 F Dec. 28, 2024, 5:06 p.m. OK C++17 (GCC 7-32) TESTS 37 249 14336000
298885768 Leo_W F Dec. 28, 2024, 5:15 p.m. OK C++17 (GCC 7-32) TESTS 37 249 38400000
298890445 sillylittleidiot77 F Dec. 28, 2024, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 37 265 24473600
298877390 kmjp F Dec. 28, 2024, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 37 296 15462400
298881385 furry F Dec. 28, 2024, 4:59 p.m. OK C++20 (GCC 13-64) TESTS 37 171 22425600
298896751 kotatsugame F Dec. 28, 2024, 6:46 p.m. OK C++20 (GCC 13-64) TESTS 37 187 7372800
298895578 Zesty_Fox F Dec. 28, 2024, 6:36 p.m. OK C++20 (GCC 13-64) TESTS 37 187 9625600
298923424 acat F Dec. 29, 2024, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 37 187 16179200
298878207 LuCpp F Dec. 28, 2024, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 37 187 17715200
298919575 adam01 F Dec. 29, 2024, 3:39 a.m. OK C++20 (GCC 13-64) TESTS 37 202 37068800
298901356 kaiboy F Dec. 28, 2024, 7:38 p.m. OK C++20 (GCC 13-64) TESTS 37 217 11264000
298887298 Coder-Osman F Dec. 28, 2024, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 37 217 45875200
298879002 xuanxuan001 F Dec. 28, 2024, 4:51 p.m. OK C++20 (GCC 13-64) TESTS 37 218 17612800
298889983 LYY_yyyy F Dec. 28, 2024, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 37 218 36249600
298899698 regain0001 F Dec. 28, 2024, 7:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 108 12185600
298907158 415411 F Dec. 28, 2024, 9:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 187 14848000
298886136 lcyxds F Dec. 28, 2024, 5:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 202 13926400
298901656 regain0001 F Dec. 28, 2024, 7:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 202 16384000
298911823 volodya_petarda F Dec. 28, 2024, 11:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 202 19456000
298906960 415411 F Dec. 28, 2024, 9:12 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 202 21094400
298890888 Sxrqwq F Dec. 28, 2024, 5:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 217 50790400
298894985 tfg F Dec. 28, 2024, 6:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 218 22732800
298887981 CJ-zhuyifan F Dec. 28, 2024, 5:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 234 50073600
298900075 SSerxhs F Dec. 28, 2024, 7:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 37 265 58675200
298905129 rainboy F Dec. 28, 2024, 8:37 p.m. OK GNU C11 TESTS 37 202 10547200
298877589 Yu_212 F Dec. 28, 2024, 4:46 p.m. OK Java 21 TESTS 37 1124 135987200
298902825 Dukkha F Dec. 28, 2024, 8 p.m. OK Java 21 TESTS 37 1233 10854400
298895865 CDastrup F Dec. 28, 2024, 6:39 p.m. OK PyPy 3-64 TESTS 37 968 88883200
298915299 Rice_tawara459 F Dec. 29, 2024, 1:43 a.m. OK PyPy 3-64 TESTS 37 4984 108339200
298909074 PaciukZvichainyi F Dec. 28, 2024, 9:57 p.m. OK Rust 2021 TESTS 37 952 63488000

remove filters

Back to search problems