Educational Codeforces Round 173 (Rated for 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
2043 Educational Codeforces Round 173 (Rated for Div. 2) FINISHED False 7200 41354723 Dec. 24, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1816 ) E Matrix Transformation PROGRAMMING bitmasks brute force dfs and similar graphs implementation

You are given two matrices [A] and [B] of size [n \times m], filled with integers between [0] and [10^9]. You can perform the following operations on matrix [A] in any order and any number of times: &= : choose two integers [i] and [x] ([1 \le i \le n], [x \ge 0]) and replace each element in row [i] with the result of the bitwise AND operation between [x] and that element. Formally, for every [j \in [1, m]], the element [A_{i,j}] is replaced with [A_{i,j} \text{ & } x]; |= : choose two integers [j] and [x] ([1 \le j \le m], [x \ge 0]) and replace each element in column [j] with the result of the bitwise OR operation between [x] and that element. Formally, for every [i \in [1, n]], the element [A_{i,j}] is replaced with [A_{i,j} \text{ | } x]. The value of [x] may be chosen differently for different operations. Determine whether it is possible to transform matrix [A] into matrix [B] using the given operations any number of times (including zero). The first line contains a single integer [t] ([1 \le t \le 100]) — the number of test cases. Then, [t] test cases follow. Each test case is given as follows: the first line contains two integers [n] and [m] ([1 \le n, m \le 10^3]; [n \cdot m \le 10^3]) — the dimensions of the matrices [A] and [B]; the following [n] lines describe the matrix [A], where the [i]-th line contains [m] integers [A_{i,1}, A_{i,2}, \dots, A_{i,m}] ([0 \le A_{i,j} \le 10^9]); the following [n] lines describe the matrix [B], where the [i]-th line contains [m] integers [B_{i,1}, B_{i,2}, \dots, B_{i,m}] ([0 \le B_{i,j} \le 10^9]). For each test case, output Yes if it is possible to transform the matrix [A] into the matrix [B]; otherwise, output No . Each letter can be output in any case, upper or lower. Let's consider the second set of input data

Tutorials

Educational Codeforces Round 173 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
298346333 B_3 E Dec. 24, 2024, 11:10 p.m. OK C++17 (GCC 7-32) TESTS 13 93 102400
298345908 B_3 E Dec. 24, 2024, 10:57 p.m. OK C++17 (GCC 7-32) TESTS 13 93 102400
298352323 nai0610 E Dec. 25, 2024, 2:24 a.m. OK C++17 (GCC 7-32) TESTS 13 93 8192000
298355131 alan-c E Dec. 25, 2024, 3:25 a.m. OK C++17 (GCC 7-32) TESTS 13 109 12083200
298348275 S4muraj E Dec. 25, 2024, 12:20 a.m. OK C++17 (GCC 7-32) TESTS 13 124 8192000
298315038 Lodha11 E Dec. 24, 2024, 5:55 p.m. OK C++17 (GCC 7-32) TESTS 13 124 10240000
298303246 dontforgetyourself E Dec. 24, 2024, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 13 124 10240000
298315096 masa.dobric E Dec. 24, 2024, 5:55 p.m. OK C++17 (GCC 7-32) TESTS 13 124 12185600
298314179 TomazGomes E Dec. 24, 2024, 5:49 p.m. OK C++17 (GCC 7-32) TESTS 13 124 16896000
298302853 LinkZelda E Dec. 24, 2024, 4:47 p.m. OK C++17 (GCC 7-32) TESTS 13 125 9318400
298354277 2018LZY E Dec. 25, 2024, 3:07 a.m. OK C++20 (GCC 13-64) TESTS 13 77 8192000
298322023 MEDAA E Dec. 24, 2024, 6:49 p.m. OK C++20 (GCC 13-64) TESTS 13 78 0
298354469 2018LZY E Dec. 25, 2024, 3:11 a.m. OK C++20 (GCC 13-64) TESTS 13 93 8192000
298324926 DaniraSilla E Dec. 24, 2024, 7:16 p.m. OK C++20 (GCC 13-64) TESTS 13 108 102400
298318853 Justinshao E Dec. 24, 2024, 6:23 p.m. OK C++20 (GCC 13-64) TESTS 13 108 102400
298344993 Binww E Dec. 24, 2024, 10:30 p.m. OK C++20 (GCC 13-64) TESTS 13 108 16384000
298346943 whiitex E Dec. 24, 2024, 11:30 p.m. OK C++20 (GCC 13-64) TESTS 13 109 102400
298338804 Nxxlt E Dec. 24, 2024, 8:38 p.m. OK C++20 (GCC 13-64) TESTS 13 109 102400
298338048 -Satrix- E Dec. 24, 2024, 8:27 p.m. OK C++20 (GCC 13-64) TESTS 13 109 102400
298337797 hesham E Dec. 24, 2024, 8:24 p.m. OK C++20 (GCC 13-64) TESTS 13 109 102400
298354020 YuukiS E Dec. 25, 2024, 3:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 77 0
298353941 YuukiS E Dec. 25, 2024, 3 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 78 102400
298311073 Khaled_Kamal_ E Dec. 24, 2024, 5:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 93 0
298305960 deadeffect7 E Dec. 24, 2024, 5 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 93 0
298341733 andrei_C1 E Dec. 24, 2024, 9:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 93 102400
298302209 TranscendentalX E Dec. 24, 2024, 4:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 108 102400
298302071 gxd E Dec. 24, 2024, 4:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 108 8192000
298353974 LoveYYing E Dec. 25, 2024, 3:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 108 16281600
298338347 a.out E Dec. 24, 2024, 8:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 13 109 0
298358609 user10086 E Dec. 25, 2024, 4:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 109 8294400
298334258 lyongwolf E Dec. 24, 2024, 7:43 p.m. OK Java 21 TESTS 13 374 512000
298315114 arnabmanna E Dec. 24, 2024, 5:56 p.m. OK Java 21 TESTS 13 515 1740800
298348918 smilences E Dec. 25, 2024, 12:44 a.m. OK PyPy 3-64 TESTS 13 234 9523200
298322345 Naruto_x E Dec. 24, 2024, 6:52 p.m. OK PyPy 3-64 TESTS 13 530 11264000

remove filters

Back to search problems