Codeforces Round 963 (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
1993 Codeforces Round 963 (Div. 2) FINISHED False 7200 53623523 Aug. 4, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 725 ) E Xor-Grid Problem PROGRAMMING bitmasks dp

Given a matrix (a) of size (n \times m), each cell of which contains a non-negative integer. The integer lying at the intersection of the (i)-th row and the (j)-th column of the matrix is called (a_{i,j}). Let's define (f(i)) and (g(j)) as the XOR of all integers in the (i)-th row and the (j)-th column, respectively. In one operation, you can either: Select any row (i), then assign (a_{i,j} := g(j)) for each (1 \le j \le m); or Select any column (j), then assign (a_{i,j} := f(i)) for each (1 \le i \le n). In this example, as we apply an operation on column (2), all elements in this column are changed: (a_{1,2} := f(1) = a_{1,1} \oplus a_{1,2} \oplus a_{1,3} \oplus a_{1,4} = 1 \oplus 1 \oplus 1 \oplus 1 = 0) (a_{2,2} := f(2) = a_{2,1} \oplus a_{2,2} \oplus a_{2,3} \oplus a_{2,4} = 2 \oplus 3 \oplus 5 \oplus 7 = 3) (a_{3,2} := f(3) = a_{3,1} \oplus a_{3,2} \oplus a_{3,3} \oplus a_{3,4} = 2 \oplus 0 \oplus 3 \oplus 0 = 1) (a_{4,2} := f(4) = a_{4,1} \oplus a_{4,2} \oplus a_{4,3} \oplus a_{4,4} = 10 \oplus 11 \oplus 12 \oplus 16 = 29) You can apply the operations any number of times. Then, we calculate the (\textit{beauty}) of the final matrix by summing the absolute differences between all pairs of its adjacent cells. More formally, (\textit{beauty}(a) = \sum|a_{x,y} - a_{r,c}|) for all cells ((x, y)) and ((r, c)) if they are adjacent. Two cells are considered adjacent if they share a side. Find the minimum (\textit{beauty}) among all obtainable matrices. The first line contains a single integer (t) ((1 \le t \le 250)) — the number of test cases. The first line of each test case contains two integers (n) and (m) ((1 \le n, m \le 15)) — the number of rows and columns of (a), respectively. The next (n) lines, each containing (m) integers (a_{i,1}, a_{i,2}, \ldots, a_{i,m}) ((0 \le a_{i,j} < 2^{20})) — description of the matr

Tutorials

Editorial of Codeforces Round 963 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
274477715 lcx2007 E Aug. 5, 2024, 5:13 a.m. OK C++14 (GCC 6-32) TESTS 20 906 4198400
274479298 LOOP0 E Aug. 5, 2024, 5:30 a.m. OK C++14 (GCC 6-32) TESTS 20 1577 10547200
274452280 Ternary_Tree_ E Aug. 4, 2024, 10:46 p.m. OK C++14 (GCC 6-32) TESTS 20 1858 142950400
274424269 chennie E Aug. 4, 2024, 5:31 p.m. OK C++14 (GCC 6-32) TESTS 20 1890 5836800
274470922 qqqaaazzz E Aug. 5, 2024, 3:48 a.m. OK C++14 (GCC 6-32) TESTS 20 2593 5222400
274415579 Darko1 E Aug. 4, 2024, 4:24 p.m. OK C++14 (GCC 6-32) TESTS 20 4358 2150400
274430686 Andreasyan E Aug. 4, 2024, 6:09 p.m. OK C++17 (GCC 7-32) TESTS 20 874 8908800
274438043 srivastavaaryanalc76 E Aug. 4, 2024, 7:13 p.m. OK C++17 (GCC 7-32) TESTS 20 921 4300800
274423843 dreamoon_love_AA E Aug. 4, 2024, 5:30 p.m. OK C++17 (GCC 7-32) TESTS 20 1171 134553600
274474036 Alpha_Q E Aug. 5, 2024, 4:30 a.m. OK C++17 (GCC 7-32) TESTS 20 1249 2867200
274426074 sgc_KrySF E Aug. 4, 2024, 5:39 p.m. OK C++17 (GCC 7-32) TESTS 20 1264 231833600
274480025 PhoenixRebirth E Aug. 5, 2024, 5:36 a.m. OK C++17 (GCC 7-32) TESTS 20 1390 4505600
274452610 Ste E Aug. 4, 2024, 10:54 p.m. OK C++17 (GCC 7-32) TESTS 20 1406 2662400
274424641 QioCas E Aug. 4, 2024, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 20 1421 160563200
274441737 RigBuhBuh E Aug. 4, 2024, 7:53 p.m. OK C++17 (GCC 7-32) TESTS 20 1609 138854400
274473749 AkiLotus E Aug. 5, 2024, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 20 1671 203264000
274425111 neal E Aug. 4, 2024, 5:34 p.m. OK C++20 (GCC 13-64) TESTS 20 437 614400
274436076 makcvim E Aug. 4, 2024, 6:54 p.m. OK C++20 (GCC 13-64) TESTS 20 499 5324800
274440547 maxwellzen E Aug. 4, 2024, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 20 640 130867200
274469662 pengyantong E Aug. 5, 2024, 3:32 a.m. OK C++20 (GCC 13-64) TESTS 20 733 4198400
274480435 shyam_17 E Aug. 5, 2024, 5:40 a.m. OK C++20 (GCC 13-64) TESTS 20 765 4198400
274469754 another_asian E Aug. 5, 2024, 3:33 a.m. OK C++20 (GCC 13-64) TESTS 20 765 4198400
274461118 aklk1ng E Aug. 5, 2024, 1:50 a.m. OK C++20 (GCC 13-64) TESTS 20 781 4198400
274458849 Tobo E Aug. 5, 2024, 1:14 a.m. OK C++20 (GCC 13-64) TESTS 20 827 4198400
274426792 ymmparsa E Aug. 4, 2024, 5:43 p.m. OK C++20 (GCC 13-64) TESTS 20 843 4198400
274417116 eFanJu E Aug. 4, 2024, 4:28 p.m. OK C++20 (GCC 13-64) TESTS 20 874 146124800
274467260 profchi E Aug. 5, 2024, 3:03 a.m. OK Java 8 TESTS 20 4233 229785600
274430608 misorin E Aug. 4, 2024, 6:08 p.m. OK PyPy 3-64 TESTS 20 3546 27852800
274436188 vwxyz0 E Aug. 4, 2024, 6:55 p.m. OK PyPy 3-64 TESTS 20 4202 28262400
274479381 tan-jie-xi E Aug. 5, 2024, 5:31 a.m. OK PyPy 3-64 TESTS 20 4203 28160000
274481532 Little_Sheep_Yawn E Aug. 5, 2024, 5:51 a.m. OK PyPy 3-64 TESTS 20 4280 23859200
274419802 toor E Aug. 4, 2024, 4:33 p.m. OK Rust 2021 TESTS 20 1609 4812800

remove filters

Back to search problems