Codeforces Round 1010 (Div. 1, Unrated)

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
2081 Codeforces Round 1010 (Div. 1, Unrated) FINISHED False 10800 34356323 March 15, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 139 ) F Hot Matrix PROGRAMMING constructive algorithms math

Piggy Zhou loves matrices, especially those that make him get excited, called hot matrix . A hot matrix of size (n \times n) can be defined as follows. Let (a_{i, j}) denote the element in the (i)-th row, (j)-th column ((1 \le i, j \le n)). Each column and row of the matrix is a permutation of all numbers from (0) to (n-1). For each pair of indices (i), (j), such that (1 \le i, j \le n), (a_{i, j} + a_{i, n - j + 1} = n - 1). For each pair of indices (i), (j), such that (1 \le i, j \le n), (a_{i, j} + a_{n - i + 1, j} = n - 1). All ordered pairs (\left(a_{i, j}, a_{i, j + 1}\right)), where (1 \le i \le n), (1 \le j < n), are distinct. All ordered pairs (\left(a_{i, j}, a_{i + 1, j}\right)), where (1 \le i < n), (1 \le j \le n), are distinct. Now, Piggy Zhou gives you a number (n), and you need to provide him with a hot matrix if the hot matrix exists for the given (n), or inform him that he will never get excited if the hot matrix does not exist for the given (n). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The only line of each test case contains one integer (n) ((1 \le n \le 3000)). It is guaranteed that the sum of (n) across all test cases does not exceed (3000). For each test case, print " NO " (without quotes) if the hot matrix does not exist for the given (n). Otherwise, print " YES " (without quotes) on the first line. Then output (n) rows, with (n) numbers in each row, representing the hot matrix of size (n\times n) that meets the requirements of the problem. If there are multiple solutions, print any of them. In the first, second and fourth test case, it can be verified that the matrix provided in the example meets all the conditions stated in the problem. In the third test case, by enumerating all pos

Tutorials

Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
310771700 potato167 F March 15, 2025, 5:13 p.m. OK C++17 (GCC 7-32) TESTS 13 921 45260800
310762358 cdxcdxcdxcdx F March 15, 2025, 4:21 p.m. OK C++20 (GCC 13-64) TESTS 13 483 24985600
310754815 A_G F March 15, 2025, 3:48 p.m. OK C++20 (GCC 13-64) TESTS 13 531 102400
310779543 A_G F March 15, 2025, 6:11 p.m. OK C++20 (GCC 13-64) TESTS 13 546 102400
310801279 Sparkle_Twilight F March 15, 2025, 9:43 p.m. OK C++20 (GCC 13-64) TESTS 13 639 35532800
310787520 Benq F March 15, 2025, 7:19 p.m. OK C++20 (GCC 13-64) TESTS 13 671 35532800
310765116 Alex239 F March 15, 2025, 4:35 p.m. OK C++20 (GCC 13-64) TESTS 13 2936 75366400
310784390 jatking F March 15, 2025, 6:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 577 0
310769239 arvindf232 F March 15, 2025, 4:58 p.m. OK Kotlin 1.9 TESTS 13 1124 80896000

remove filters

Back to search problems