Codeforces Round 857 (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
1801 Codeforces Round 857 (Div. 1) FINISHED False 10800 58825463 March 9, 2023, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8833 ) A The Very Beautiful Blanket PROGRAMMING bitmasks constructive algorithms

B'Kirill wants to weave the very beautiful blanket consisting of n x m of the same size square patches of some colors. He matched some non-negative integer to each color. Thus, in our problem, the blanket can be considered a B matrix of size n x m consisting of non-negative integers. Kirill considers that the blanket is very beautiful, if for each submatrix A of size 4 x 4 of the matrix B is true: where oplus means bitwise exclusive OR Kirill asks you to help her weave a very beautiful blanket, and as colorful as possible! He gives you two integers n and m . Your task is to generate a matrix B of size n x m , which corresponds to a very beautiful blanket and in which the number of different numbers maximized. The first line of input data contains one integer number t ( 1 <= t <= 1000 ) -- the number of test cases. The single line of each test case contains two integers n and m (4 <= n, , m <= 200) -- the size of matrix B . It is guaranteed that the sum of n cdot m does not exceed 2 cdot 10^5 . For each test case, in first line output one integer cnt (1 <= cnt <= n cdot m) -- the maximum number of different numbers in the matrix. Then output the matrix B (0 <= B_{ij} < 2^{63}) of size n x m . If there are several correct matrices, it is allowed to output any one. It can be shown that if there exists a matrix with an optimal number of distinct numbers, then there exists among suitable matrices such a B that (0 <= B_{ij} < 2^{63}) . In the first test case, there is only 4 submatrix of size 4 x 4 . Consider a submatrix whose upper-left corner coincides with the upper-left corner of the matrix B : <= ft[ { begin{array}{cccc} 9740 & 1549 & 9744 & 1553 1550 & 1551 & 1554 & 1555 10252 & 2061 & 10256 & 2065 2062 & 2063 & 2066 & 2067 end{array} } ri'...

Tutorials

Codeforces Round #857 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
196608052 mban259 A March 9, 2023, 9:55 a.m. OK C# 10 TESTS 9 61 6553600
196606395 KumaTachiRen A March 9, 2023, 9:51 a.m. OK C# 8 TESTS 9 951 5632000
196601472 hos.lyric A March 9, 2023, 9:39 a.m. OK D TESTS 9 171 0
196726431 Moka50 A March 10, 2023, 12:46 a.m. OK GNU C11 TESTS 9 826 7987200
196602174 realFZzzz A March 9, 2023, 9:42 a.m. OK GNU C++14 TESTS 9 31 0
196729188 Williamxzh A March 10, 2023, 2 a.m. OK GNU C++14 TESTS 9 31 0
196679183 AkaiLemon A March 9, 2023, 3:17 p.m. OK GNU C++14 TESTS 9 31 0
196611492 zym417 A March 9, 2023, 10:04 a.m. OK GNU C++14 TESTS 9 31 307200
196612660 Jormungandre A March 9, 2023, 10:08 a.m. OK GNU C++14 TESTS 9 31 307200
196637558 ztlh A March 9, 2023, 11:29 a.m. OK GNU C++14 TESTS 9 31 307200
196621885 Violet_Holmes A March 9, 2023, 10:37 a.m. OK GNU C++14 TESTS 9 31 409600
196611896 peiwenjun A March 9, 2023, 10:05 a.m. OK GNU C++14 TESTS 9 31 409600
196606960 1213James A March 9, 2023, 9:53 a.m. OK GNU C++14 TESTS 9 31 409600
196665872 Dispensable A March 9, 2023, 1:51 p.m. OK GNU C++14 TESTS 9 31 409600
196686286 prafull_08 A March 9, 2023, 4:20 p.m. OK GNU C++17 TESTS 9 31 0
196615525 dyxx A March 9, 2023, 10:16 a.m. OK GNU C++17 TESTS 9 31 0
196609647 sotanishy A March 9, 2023, 9:59 a.m. OK GNU C++17 TESTS 9 31 0
196607600 El3ageed_Abu_Shehab A March 9, 2023, 9:54 a.m. OK GNU C++17 TESTS 9 31 0
196606059 Kath1031 A March 9, 2023, 9:50 a.m. OK GNU C++17 TESTS 9 31 0
196606018 NKheyuxiang A March 9, 2023, 9:50 a.m. OK GNU C++17 TESTS 9 31 0
196704730 Smit_prajapati01 A March 9, 2023, 6:50 p.m. OK GNU C++17 TESTS 9 31 0
196613506 patou A March 9, 2023, 10:10 a.m. OK GNU C++17 TESTS 9 31 307200
196614508 Atekichan A March 9, 2023, 10:14 a.m. OK GNU C++17 TESTS 9 31 307200
196611069 John_zyj A March 9, 2023, 10:03 a.m. OK GNU C++17 TESTS 9 31 409600
196616209 fexla A March 9, 2023, 10:18 a.m. OK GNU C++17 (64) TESTS 9 30 0
196601759 Rubikun A March 9, 2023, 9:41 a.m. OK GNU C++17 (64) TESTS 9 30 0
196683779 Monir A March 9, 2023, 4 p.m. OK GNU C++17 (64) TESTS 9 30 0
196612851 HCPS42 A March 9, 2023, 10:08 a.m. OK GNU C++17 (64) TESTS 9 30 716800
196623981 QAQAutoMaton A March 9, 2023, 10:44 a.m. OK GNU C++17 (64) TESTS 9 30 4505600
196682085 AUDzer0 A March 9, 2023, 3:47 p.m. OK GNU C++17 (64) TESTS 9 31 0
196606715 5ab A March 9, 2023, 9:52 a.m. OK GNU C++17 (64) TESTS 9 31 0
196606225 Andreasyan A March 9, 2023, 9:51 a.m. OK GNU C++17 (64) TESTS 9 31 0
196629441 Xellos A March 9, 2023, 11:02 a.m. OK GNU C++17 (64) TESTS 9 31 0
196682811 AmirAli-Asgari A March 9, 2023, 3:52 p.m. OK GNU C++17 (64) TESTS 9 31 0
196695769 PingPongBall777 A March 9, 2023, 5:35 p.m. OK GNU C++20 (64) TESTS 9 15 0
196696004 PingPongBall777 A March 9, 2023, 5:37 p.m. OK GNU C++20 (64) TESTS 9 15 0
196677486 oiocha A March 9, 2023, 3:04 p.m. OK GNU C++20 (64) TESTS 9 15 0
196639567 Harsha221B A March 9, 2023, 11:36 a.m. OK GNU C++20 (64) TESTS 9 15 0
196627455 Alexdat2000 A March 9, 2023, 10:56 a.m. OK GNU C++20 (64) TESTS 9 15 0
196606198 KDVineet A March 9, 2023, 9:51 a.m. OK GNU C++20 (64) TESTS 9 15 0
196604626 CDuongg A March 9, 2023, 9:47 a.m. OK GNU C++20 (64) TESTS 9 15 0
196602065 atodo A March 9, 2023, 9:42 a.m. OK GNU C++20 (64) TESTS 9 15 0
196601543 jiangly A March 9, 2023, 9:39 a.m. OK GNU C++20 (64) TESTS 9 15 0
196664755 pavement A March 9, 2023, 1:47 p.m. OK GNU C++20 (64) TESTS 9 15 307200
196616157 profchi A March 9, 2023, 10:18 a.m. OK Java 11 TESTS 9 202 0
196625195 insert_cool_handle A March 9, 2023, 10:48 a.m. OK Java 11 TESTS 9 280 0
196720496 creativegiant A March 9, 2023, 10:15 p.m. OK Java 11 TESTS 9 826 0
196720516 creativegiant A March 9, 2023, 10:15 p.m. OK Java 11 TESTS 9 857 0
196621110 TCchen A March 9, 2023, 10:35 a.m. OK Java 17 TESTS 9 264 204800
196722390 safarisoul A March 9, 2023, 10:55 p.m. OK Java 8 TESTS 9 124 0
196604241 iakovlev.zakhar A March 9, 2023, 9:47 a.m. OK Java 8 TESTS 9 186 0
196603984 fetetriste A March 9, 2023, 9:46 a.m. OK Java 8 TESTS 9 358 0
196679323 dualthread A March 9, 2023, 3:18 p.m. OK Java 8 TESTS 9 717 0
196601502 FastFreeTask A March 9, 2023, 9:39 a.m. OK Kotlin 1.6 TESTS 9 218 512000
196611047 Hakiobo A March 9, 2023, 10:03 a.m. OK Kotlin 1.6 TESTS 9 233 0
196603202 darnley A March 9, 2023, 9:44 a.m. OK Kotlin 1.7 TESTS 9 639 67072000
196601753 shobonvip A March 9, 2023, 9:40 a.m. OK PyPy 3 TESTS 9 140 8192000
196604500 FlakeLCR A March 9, 2023, 9:47 a.m. OK PyPy 3-64 TESTS 9 108 9216000
196729153 br1ck A March 10, 2023, 1:59 a.m. OK PyPy 3-64 TESTS 9 109 10035200
196682175 clam A March 9, 2023, 3:48 p.m. OK PyPy 3-64 TESTS 9 109 10035200
196725826 plevande A March 10, 2023, 12:31 a.m. OK PyPy 3-64 TESTS 9 124 9625600
196738069 Mohamed_Hamed A March 10, 2023, 5 a.m. OK PyPy 3-64 TESTS 9 124 10752000
196609771 ankan2526 A March 9, 2023, 10 a.m. OK PyPy 3-64 TESTS 9 139 140492800
196669218 FlakeLCR A March 9, 2023, 2:09 p.m. OK PyPy 3-64 TESTS 9 140 9523200
196604066 tamato A March 9, 2023, 9:46 a.m. OK PyPy 3-64 TESTS 9 140 9625600
196612285 dabbler1 A March 9, 2023, 10:06 a.m. OK PyPy 3-64 TESTS 9 140 10035200
196601989 toam A March 9, 2023, 9:41 a.m. OK PyPy 3-64 TESTS 9 155 9830400
196734730 klu_2100039088 A March 10, 2023, 4:03 a.m. OK Python 3 TESTS 9 296 0
196738372 yadavDipesh A March 10, 2023, 5:05 a.m. OK Python 3 TESTS 9 311 102400

remove filters

Back to search problems