Codeforces Round 777 (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
1647 Codeforces Round 777 (Div. 2) FINISHED False 7200 90257063 March 11, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12797 ) C Madoka and Childish Pranks PROGRAMMING constructive algorithms greedy

B'Madoka as a child was an extremely capricious girl, and one of her favorite pranks was drawing on her wall. According to Madoka 's memories, the wall was a table of n rows and m columns, consisting only of zeroes and ones. The coordinate of the cell in the i -th row and the j -th column ( 1 <= i <= n , 1 <= j <= m ) is (i, j) . One day she saw a picture "Mahou Shoujo Madoka Magica" and decided to draw it on her wall. Initially, the Madoka 's table is a table of size n x m filled with zeroes. Then she applies the following operation any number of times: Madoka selects any rectangular subtable of the table and paints it in a chess coloring (the upper left corner of the subtable always has the color 0 ). Note that some cells may be colored several times. In this case, the final color of the cell is equal to the color obtained during the last repainting. For better understanding of the statement, we recommend you to read the explanation of the first test. Help Madoka and find some sequence of no more than n cdot m operations that allows you to obtain the picture she wants, or determine that this is impossible. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n, m <= q 100 ) -- the size of the table. Each of the following n lines contains a string of length m consisting only of 1 and 0 -- description of the picture that Madoka wants to obtain. If it is impossible to obtain the given picture, print -1 . Otherwise, print in the first line a single integer q ( 0 <= q q <= q n cdot m ) -- the number of operations you need to obtain the picture. Note that you do not need to minimize the number of operations. Then for each operation (in the orde'...

Tutorials

Codeforces Round #777 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
149318650 nhanhoang510 C March 11, 2022, 4:21 p.m. OK FPC TESTS 8 233 0
149321373 ppsracchriskim C March 11, 2022, 4:28 p.m. OK GNU C11 TESTS 8 358 0
149365025 2020065208gb C March 12, 2022, 1:16 a.m. OK GNU C++14 TESTS 9 15 0
149347253 kritipandey C March 11, 2022, 6:40 p.m. OK GNU C++14 TESTS 8 15 0
149329376 lixuanta C March 11, 2022, 5:01 p.m. OK GNU C++14 TESTS 8 15 204800
149321945 Legend_dy C March 11, 2022, 4:30 p.m. OK GNU C++14 TESTS 8 15 204800
149317117 Himeno.Sena C March 11, 2022, 4:17 p.m. OK GNU C++14 TESTS 8 15 204800
149316841 Jahid C March 11, 2022, 4:16 p.m. OK GNU C++14 TESTS 8 15 204800
149363346 1443356159 C March 12, 2022, 12:15 a.m. OK GNU C++14 TESTS 8 15 307200
149363455 final_trump C March 12, 2022, 12:19 a.m. OK GNU C++14 TESTS 8 15 614400
149346526 ImmanAnnachiFC C March 11, 2022, 6:33 p.m. OK GNU C++14 TESTS 8 15 614400
149329463 ImmanAnnachiFC C March 11, 2022, 5:02 p.m. OK GNU C++14 TESTS 8 15 614400
149348122 Ponchik4_0 C March 11, 2022, 6:49 p.m. OK GNU C++17 TESTS 8 15 0
149372495 romina.nafu C March 12, 2022, 3:37 a.m. OK GNU C++17 TESTS 9 15 0
149336866 Jester611 C March 11, 2022, 5:34 p.m. OK GNU C++17 TESTS 8 15 0
149329926 ngothithuynga259 C March 11, 2022, 5:04 p.m. OK GNU C++17 TESTS 8 15 0
149329764 zhiqiu C March 11, 2022, 5:03 p.m. OK GNU C++17 TESTS 8 15 0
149318900 Error_403 C March 11, 2022, 4:22 p.m. OK GNU C++17 TESTS 8 15 0
149318123 El.Profesor C March 11, 2022, 4:20 p.m. OK GNU C++17 TESTS 8 15 0
149316989 zhaming C March 11, 2022, 4:16 p.m. OK GNU C++17 TESTS 8 15 102400
149362809 joker70 C March 11, 2022, 11:51 p.m. OK GNU C++17 TESTS 8 15 204800
149335981 Eclipsed C March 11, 2022, 5:27 p.m. OK GNU C++17 TESTS 8 15 204800
149355925 OmarNabill C March 11, 2022, 8:31 p.m. OK GNU C++17 (64) TESTS 8 15 102400
149317268 rcb_fan C March 11, 2022, 4:17 p.m. OK GNU C++17 (64) TESTS 8 15 204800
149331261 Kh_Munis C March 11, 2022, 5:05 p.m. OK GNU C++17 (64) TESTS 8 15 307200
149373450 gesu C March 12, 2022, 3:55 a.m. OK GNU C++17 (64) TESTS 9 15 409600
149377114 anhkha1004 C March 12, 2022, 4:55 a.m. OK GNU C++17 (64) TESTS 9 15 512000
149356864 Sadlk C March 11, 2022, 8:48 p.m. OK GNU C++17 (64) TESTS 8 15 512000
149356768 fxhd C March 11, 2022, 8:46 p.m. OK GNU C++17 (64) TESTS 8 15 512000
149318501 YoungChigga C March 11, 2022, 4:21 p.m. OK GNU C++17 (64) TESTS 8 15 512000
149313422 Naruto_Uzumaki_06 C March 11, 2022, 4:06 p.m. OK GNU C++17 (64) TESTS 8 15 614400
149332583 Goddan. C March 11, 2022, 5:13 p.m. OK GNU C++17 (64) TESTS 8 15 614400
149313705 Ausp3x C March 11, 2022, 4:07 p.m. OK GNU C++20 (64) TESTS 8 0 512000
149339671 Shahed_955 C March 11, 2022, 5:44 p.m. OK GNU C++20 (64) TESTS 8 0 614400
149352617 Adityyaa C March 11, 2022, 7:41 p.m. OK GNU C++20 (64) TESTS 8 15 0
149349702 saikatmondal_21 C March 11, 2022, 7:06 p.m. OK GNU C++20 (64) TESTS 8 15 0
149347464 tahm_id C March 11, 2022, 6:42 p.m. OK GNU C++20 (64) TESTS 8 15 0
149346888 idontknowwhyiamheree C March 11, 2022, 6:37 p.m. OK GNU C++20 (64) TESTS 8 15 0
149346292 liaoli C March 11, 2022, 6:31 p.m. OK GNU C++20 (64) TESTS 8 15 0
149378708 __Harsh__ C March 12, 2022, 5:16 a.m. OK GNU C++20 (64) TESTS 9 15 0
149354210 get_out_of_my_way C March 11, 2022, 8:03 p.m. OK GNU C++20 (64) TESTS 8 15 0
149353044 FedoretsVadim C March 11, 2022, 7:47 p.m. OK GNU C++20 (64) TESTS 8 15 0
149321112 PatchouliKnowledge C March 11, 2022, 4:28 p.m. OK Go TESTS 8 265 4505600
149335500 arthuryuan15 C March 11, 2022, 5:23 p.m. OK Java 11 TESTS 8 202 0
149337004 thesupremeone C March 11, 2022, 5:36 p.m. OK Java 11 TESTS 8 217 0
149321873 Hrufnarwa C March 11, 2022, 4:30 p.m. OK Java 11 TESTS 8 217 0
149321289 ritik0602 C March 11, 2022, 4:28 p.m. OK Java 11 TESTS 8 217 0
149370480 aditya2024 C March 12, 2022, 3 a.m. OK Java 11 TESTS 9 217 204800
149343811 henrychenOutlook C March 11, 2022, 6:09 p.m. OK Java 11 TESTS 8 218 0
149381444 Plums C March 12, 2022, 5:50 a.m. OK Java 11 TESTS 9 218 0
149369630 codingIsFun1234 C March 12, 2022, 2:41 a.m. OK Java 11 TESTS 9 218 0
149350729 Dcoder123 C March 11, 2022, 7:18 p.m. OK Java 11 TESTS 8 218 0
149328433 yudi23 C March 11, 2022, 4:55 p.m. OK Java 11 TESTS 8 218 0
149375163 -crazy_coder- C March 12, 2022, 4:25 a.m. OK Java 8 TESTS 9 93 0
149377514 tanishq044 C March 12, 2022, 5:01 a.m. OK Java 8 TESTS 9 93 0
149336201 Diaa12360 C March 11, 2022, 5:29 p.m. OK Java 8 TESTS 8 93 0
149329474 Mohamed308 C March 11, 2022, 5:02 p.m. OK Java 8 TESTS 8 93 0
149348682 CrinklyGolem C March 11, 2022, 6:55 p.m. OK Java 8 TESTS 8 108 0
149352899 Mohamed_A7med C March 11, 2022, 7:45 p.m. OK Java 8 TESTS 8 109 0
149327907 Swapniltri C March 11, 2022, 4:53 p.m. OK Java 8 TESTS 8 109 0
149318357 play55 C March 11, 2022, 4:20 p.m. OK Java 8 TESTS 8 109 0
149355971 kocko C March 11, 2022, 8:31 p.m. OK Java 8 TESTS 8 124 0
149370922 sky9313 C March 12, 2022, 3:08 a.m. OK Java 8 TESTS 9 124 0
149345299 Jarekczek C March 11, 2022, 6:21 p.m. OK Kotlin 1.4 TESTS 8 639 0
149322542 cfcfs C March 11, 2022, 4:31 p.m. OK Kotlin 1.4 TESTS 8 701 512000
149375461 darkl0rd C March 12, 2022, 4:30 a.m. OK Kotlin 1.5 TESTS 9 265 0
149318534 NanQin C March 11, 2022, 4:21 p.m. OK MS C++ 2017 TESTS 8 31 0
149317439 misaka12435 C March 11, 2022, 4:18 p.m. OK MS C++ 2017 TESTS 8 46 512000
149360627 SaifAbuR3d C March 11, 2022, 10:12 p.m. OK MS C++ 2017 TESTS 8 186 0
149339409 DenMusya C March 11, 2022, 5:42 p.m. OK MS C++ 2017 TESTS 8 187 512000
149364366 return_myself C March 12, 2022, 12:51 a.m. OK MS C++ 2017 TESTS 9 202 102400
149314978 A_Pier C March 11, 2022, 4:11 p.m. OK MS C++ 2017 TESTS 8 202 512000
149322015 fuck__ C March 11, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 8 389 512000
149314242 ChirkovM C March 11, 2022, 4:08 p.m. OK MS C++ 2017 TESTS 8 389 512000
149342560 _Mister_Doctor C March 11, 2022, 5:58 p.m. OK MS C++ 2017 TESTS 8 436 716800
149342485 _Mister_Doctor C March 11, 2022, 5:57 p.m. OK MS C++ 2017 TESTS 8 451 716800
149319481 prophetesseer C March 11, 2022, 4:23 p.m. OK .NET Core C# TESTS 8 296 10752000
149317176 Loremon C March 11, 2022, 4:17 p.m. OK Node.js TESTS 8 561 11264000
149332110 1_2_3_4_5_9 C March 11, 2022, 5:10 p.m. OK PyPy 2 TESTS 8 93 5939200
149344496 kwin C March 11, 2022, 6:15 p.m. OK PyPy 3 TESTS 8 249 10240000
149316060 quandum C March 11, 2022, 4:14 p.m. OK PyPy 3 TESTS 8 264 9113600
149363269 lucifer1004 C March 12, 2022, 12:11 a.m. OK PyPy 3 TESTS 8 295 11059200
149315470 saku7 C March 11, 2022, 4:12 p.m. OK PyPy 3 TESTS 8 295 11161600
149365525 majay1638 C March 12, 2022, 1:30 a.m. OK PyPy 3 TESTS 9 311 10240000
149318835 conqueror_of_titia C March 11, 2022, 4:22 p.m. OK PyPy 3 TESTS 8 311 10649600
149314779 lemiao12 C March 11, 2022, 4:10 p.m. OK PyPy 3 TESTS 8 311 11468800
149313467 exceptionalcoder C March 11, 2022, 4:06 p.m. OK PyPy 3 TESTS 8 326 11264000
149368263 grawlixes C March 12, 2022, 2:34 a.m. OK PyPy 3 TESTS 9 327 10547200
149363247 lucifer1004 C March 12, 2022, 12:10 a.m. OK PyPy 3 TESTS 8 327 11059200
149374435 rivnam C March 12, 2022, 4:14 a.m. OK PyPy 3-64 TESTS 9 124 11776000
149374398 Nemisis2.O C March 12, 2022, 4:13 a.m. OK PyPy 3-64 TESTS 9 124 11776000
149354052 nitish420 C March 11, 2022, 8:01 p.m. OK PyPy 3-64 TESTS 8 124 13312000
149378295 notTehlka C March 12, 2022, 5:11 a.m. OK PyPy 3-64 TESTS 9 171 11776000
149318657 raushnn C March 11, 2022, 4:21 p.m. OK PyPy 3-64 TESTS 8 186 12185600
149314429 jobsDone C March 11, 2022, 4:09 p.m. OK PyPy 3-64 TESTS 8 218 10444800
149343048 ding_don_dino C March 11, 2022, 6:03 p.m. OK PyPy 3-64 TESTS 8 249 9932800
149357700 noobsatish C March 11, 2022, 9:04 p.m. OK PyPy 3-64 TESTS 8 280 11571200
149332409 wskhanh C March 11, 2022, 5:12 p.m. OK PyPy 3-64 TESTS 8 295 13516800
149354095 sami02jain C March 11, 2022, 8:02 p.m. OK PyPy 3-64 TESTS 8 296 11776000
149316480 belsedor C March 11, 2022, 4:15 p.m. OK Python 3 TESTS 8 171 204800
149343571 bharat007 C March 11, 2022, 6:07 p.m. OK Python 3 TESTS 8 389 921600
149314723 jeyan_s C March 11, 2022, 4:10 p.m. OK Python 3 TESTS 8 405 716800
149371421 N00BGH0ST C March 12, 2022, 3:17 a.m. OK Python 3 TESTS 9 405 819200
149333062 PAG C March 11, 2022, 5:17 p.m. OK Python 3 TESTS 8 420 307200
149358681 ghannu C March 11, 2022, 9:23 p.m. OK Python 3 TESTS 8 436 819200
149323104 Sagar581 C March 11, 2022, 4:32 p.m. OK Python 3 TESTS 8 436 819200
149320750 Yinch C March 11, 2022, 4:27 p.m. OK Python 3 TESTS 8 436 819200
149317122 Mr_XF_1996 C March 11, 2022, 4:17 p.m. OK Python 3 TESTS 8 451 204800
149315266 Nipun_Jugran C March 11, 2022, 4:11 p.m. OK Python 3 TESTS 8 452 204800
149317061 alexeuler C March 11, 2022, 4:17 p.m. OK Rust 2021 TESTS 8 592 1331200

remove filters

Back to search problems