Codeforces Round 1048 (Div. 1)

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
2138 Codeforces Round 1048 (Div. 1) FINISHED False 10800 19063523 Sept. 8, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 237 ) E1 Determinant Construction (Easy Version) PROGRAMMING constructive algorithms matrices

This is the easy version of the problem. The difference between the versions is that in this version, the constraints on the side length of (M) is larger and the constraints on (t) is smaller. You can hack only if you solved all versions of this problem. You are given a non-negative integer (x). Your task is to construct a square matrix (M) that satisfies all of the following conditions: The side length of (M) is at most (80). Each element of (M) is either (-1), (0), or (1). The determinant of (M) is equal to (x). Each row of (M) can have at most (3) non-zero positions, and each column of (M) can have at most (3) non-zero positions. It can be proven that such a matrix always exists. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first and only line of each test case contains an integer (x) ((0 \le x \le 10^7)) — the target value of the determinant. For each test case, output a single integer (n) ((1\le n\le 80)) representing the side length of the square matrix (M). Then, output (n) lines, the (i)-th line containing (n) integers (M_{i, 1}, M_{i, 2}, \ldots, M_{i, n}) ((M_{i, j} \in \{-1, 0, 1\})), representing the elements of matrix (M). If there are multiple matrices (M) satisfying the conditions, you may output any of them. Note that in the third test case, the following solution: ()\begin{pmatrix} 1 & 1 & -1 & 1 \\ -1 & -1 & -1 & 1 \\ 1 & -1 & 0 & -1 \\ 1 & -1 & -1 & -1 \end{pmatrix}() is not valid as there are four non-zero positions in the first row of the matrix.

Tutorials

Codeforces Round 1048 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
337694722 aanamishra2407 E1 Sept. 9, 2025, 3:30 a.m. OK C++17 (GCC 7-32) TESTS 24 93 0
337657352 izaazm E1 Sept. 8, 2025, 5:24 p.m. OK C++17 (GCC 7-32) TESTS 24 108 0
337704302 k1r1t0 E1 Sept. 9, 2025, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 24 62 102400
337697237 amano_hina E1 Sept. 9, 2025, 4:08 a.m. OK C++20 (GCC 13-64) TESTS 24 62 102400
337682347 kevinyang E1 Sept. 8, 2025, 11:32 p.m. OK C++20 (GCC 13-64) TESTS 24 62 102400
337682055 kevinyang E1 Sept. 8, 2025, 11:23 p.m. OK C++20 (GCC 13-64) TESTS 24 77 0
337654587 HaramuraNodoka E1 Sept. 8, 2025, 5:16 p.m. OK C++20 (GCC 13-64) TESTS 24 77 102400
337660696 Arterm E1 Sept. 8, 2025, 5:34 p.m. OK C++20 (GCC 13-64) TESTS 24 93 0
337626564 Denisov E1 Sept. 8, 2025, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 24 108 0
337624303 tourist E1 Sept. 8, 2025, 4 p.m. OK C++20 (GCC 13-64) TESTS 24 108 0
337687669 qiuzx E1 Sept. 9, 2025, 1:39 a.m. OK C++20 (GCC 13-64) TESTS 24 108 102400
337650292 Amoo_Safar E1 Sept. 8, 2025, 5:02 p.m. OK C++20 (GCC 13-64) TESTS 24 108 102400
337683423 Mamedov E1 Sept. 9, 2025, 12:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 0
337684913 Mamedov E1 Sept. 9, 2025, 12:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 0
337658711 ttamx E1 Sept. 8, 2025, 5:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 0
337610185 ksun48 E1 Sept. 8, 2025, 3:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 0
337696428 Andrew_sun E1 Sept. 9, 2025, 3:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
337689434 zhouyuheng2009 E1 Sept. 9, 2025, 2:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 77 102400
337641768 jiangly E1 Sept. 8, 2025, 4:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 92 0
337660521 Gheal E1 Sept. 8, 2025, 5:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 92 102400
337666393 Time_Out_Soul E1 Sept. 8, 2025, 7:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 93 0
337660341 tfg E1 Sept. 8, 2025, 5:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 93 0
337670913 Gassa E1 Sept. 8, 2025, 7:44 p.m. OK D TESTS 24 249 102400
337671518 Gassa E1 Sept. 8, 2025, 7:51 p.m. OK D TESTS 24 265 102400
337675198 Gassa E1 Sept. 8, 2025, 8:39 p.m. OK D TESTS 24 1014 102400
337675608 Gassa E1 Sept. 8, 2025, 8:46 p.m. OK D TESTS 24 1030 102400
337671820 Gassa E1 Sept. 8, 2025, 7:54 p.m. OK D TESTS 24 1343 102400
337672802 Gassa E1 Sept. 8, 2025, 8:05 p.m. OK D TESTS 24 1499 102400
337670627 Gassa E1 Sept. 8, 2025, 7:40 p.m. OK D TESTS 24 1546 102400
337671834 Gassa E1 Sept. 8, 2025, 7:54 p.m. OK D TESTS 24 1561 204800
337675281 Gassa E1 Sept. 8, 2025, 8:41 p.m. OK D TESTS 24 1577 102400
337674272 Gassa E1 Sept. 8, 2025, 8:25 p.m. OK D TESTS 24 1858 102400
337666037 rainboy E1 Sept. 8, 2025, 6:58 p.m. OK GNU C11 TESTS 24 983 102400
337667431 sunnydev E1 Sept. 8, 2025, 7:10 p.m. OK Java 8 TESTS 24 453 111411200
337673797 Dynamic_Vector E1 Sept. 8, 2025, 8:18 p.m. OK PyPy 3-64 TESTS 24 156 6451200
337642220 bribritt E1 Sept. 8, 2025, 4:41 p.m. OK PyPy 3-64 TESTS 24 156 6553600
337677754 bronze_coder E1 Sept. 8, 2025, 9:26 p.m. OK PyPy 3-64 TESTS 24 202 10342400
337645840 Ritwin E1 Sept. 8, 2025, 4:50 p.m. OK PyPy 3-64 TESTS 24 249 10649600
337675909 bronze_coder E1 Sept. 8, 2025, 8:51 p.m. OK PyPy 3-64 TESTS 24 249 10752000
337652138 Sugar_fan E1 Sept. 8, 2025, 5:08 p.m. OK Rust 2024 TESTS 24 155 102400

remove filters

Back to search problems