Codeforces Round 941 (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
1966 Codeforces Round 941 (Div. 2) FINISHED False 7200 22951463 April 27, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15436 ) B Rectangle Filling PROGRAMMING constructive algorithms implementation 1100

B'There is an n x m grid of white and black squares. In one operation, you can select any two squares of the same color, and color all squares in the subrectangle between them that color. Formally, if you select positions (x_1, y_1) and (x_2, y_2) , both of which are currently the same color c , set the color of all (x, y) where min(x_1, x_2) <= x <= max(x_1, x_2) and min(y_1, y_2) <= y <= max(y_1, y_2) to c . This diagram shows a sequence of two possible operations on a grid: Is it possible for all squares in the grid to be the same color, after performing any number of operations (possibly zero)? The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= n, m <= 500 ) -- the number of rows and columns in the grid, respectively. Each of the next n lines contains m characters 'W ' and 'B ' -- the initial colors of the squares of the grid. It is guaranteed that the sum of n cdot m over all test cases does not exceed 3 cdot 10^5 . For each test case, print "YES" if it is possible to make all squares in the grid the same color, and "NO" otherwise. You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In the first example, it is impossible to ever change the color of any square with an operation, so we output NO. The second example is the case pictured above. As shown in that diagram, it is possible for all squares to be white after two operations, so we output YES. In the third and fourth examples, all squares are already the same color, so we output YES. In the fifth example we can do everything in two operations. First, select positions (2, 1) and (1, 4) and color all squares with'...

Tutorials

Codeforces Round #941 (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
259752882 beyanon B May 6, 2024, 1 p.m. OK C# 10 TESTS 15 93 3481600 1100
263650251 _Dhumketu_ B June 1, 2024, 3:36 p.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
261742712 unordinary_substance B May 20, 2024, 8:10 a.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
261435929 adityagoyal_03 B May 17, 2024, 9:26 p.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
261344241 ayushk1234 B May 17, 2024, 2:32 p.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
260597643 NothingAtall B May 12, 2024, 1:58 a.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
259001688 megatron10 B May 1, 2024, 11:39 a.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
258826996 binhan2009 B April 30, 2024, 7:49 a.m. OK C++14 (GCC 6-32) TESTS 15 46 0 1100
259452653 tanqiyun B May 4, 2024, 6:08 a.m. OK C++14 (GCC 6-32) TESTS 15 46 102400 1100
262007387 dxy430104 B May 21, 2024, 11:35 a.m. OK C++14 (GCC 6-32) TESTS 15 46 307200 1100
261480505 xglight B May 18, 2024, 7:29 a.m. OK C++14 (GCC 6-32) TESTS 15 46 307200 1100
263091240 -NOT B May 29, 2024, 5:45 a.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
263085121 simonsimple305 B May 29, 2024, 4:24 a.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
263053360 Poco_le B May 28, 2024, 6:30 p.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
263033832 Arghay013 B May 28, 2024, 3:39 p.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262909870 relatingCoder B May 27, 2024, 4:29 p.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262905503 themanviv007 B May 27, 2024, 3:52 p.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262482790 vjudge2 B May 25, 2024, 8:46 a.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262450098 farmpiggie B May 25, 2024, 2:43 a.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262438747 Dr_Ahmad B May 24, 2024, 9:20 p.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
262366629 Mugiwara_HS B May 24, 2024, 10:03 a.m. OK C++17 (GCC 7-32) TESTS 15 46 0 1100
263700139 GRENINZA B June 2, 2024, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
263370884 Ezreal_ B May 30, 2024, 5:45 p.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
263148771 Crowley2711 B May 29, 2024, 1:33 p.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
263059468 lelouchlamperouge336 B May 28, 2024, 7:40 p.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262970583 skipp B May 28, 2024, 6:56 a.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262918593 once_a__legend B May 27, 2024, 5:51 p.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262906498 Ziad.Medhat B May 27, 2024, 4 p.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262837839 kalpking B May 27, 2024, 6:49 a.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262690764 hemlocktree B May 26, 2024, 10:45 a.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
262678972 IvanovAl B May 26, 2024, 9:07 a.m. OK C++20 (GCC 13-64) TESTS 15 46 0 1100
259084107 Alexanderter10 B May 2, 2024, 5:34 a.m. OK FPC TESTS 15 140 0 1100
259011124 bestelsuvn B May 1, 2024, 1:16 p.m. OK FPC TESTS 15 155 307200 1100
262329614 Utkarsh.iitkgp B May 24, 2024, 3:42 a.m. OK GNU C11 TESTS 15 77 204800 1100
260956779 anirudh2005 B May 14, 2024, 4:39 p.m. OK GNU C11 TESTS 15 77 307200 1100
259622861 dhruv_singh1 B May 5, 2024, 11:09 a.m. OK GNU C11 TESTS 15 77 1024000 1100
259874265 cccccqw B May 7, 2024, 12:30 p.m. OK GNU C11 TESTS 15 93 102400 1100
262467382 MartynasJ B May 25, 2024, 6:22 a.m. OK GNU C11 TESTS 15 93 204800 1100
259542898 titan_t3 B May 4, 2024, 5:43 p.m. OK GNU C11 TESTS 15 93 204800 1100
259119928 kreesh_17 B May 2, 2024, 12:31 p.m. OK GNU C11 TESTS 15 93 204800 1100
259958733 Sn_9 B May 8, 2024, 6:42 a.m. OK GNU C11 TESTS 15 93 307200 1100
258836270 sagor_NSTU_18 B April 30, 2024, 9:53 a.m. OK GNU C11 TESTS 15 93 307200 1100
258828920 BortiK B April 30, 2024, 8:18 a.m. OK GNU C11 TESTS 15 93 307200 1100
259599607 ykt836 B May 5, 2024, 7:45 a.m. OK Go TESTS 15 62 1536000 1100
261960367 nguyenquocthao00 B May 21, 2024, 4:16 a.m. OK Go TESTS 15 62 1843200 1100
259433873 nguyenquocthao00 B May 4, 2024, 1:27 a.m. OK Go TESTS 15 62 1843200 1100
261079757 PepRe B May 15, 2024, 4:13 p.m. OK Go TESTS 15 62 2662400 1100
258855814 nguyenquocthao00 B April 30, 2024, 1:08 p.m. OK Go TESTS 15 77 1843200 1100
259548272 botayhard B May 4, 2024, 6:36 p.m. OK Go TESTS 15 77 10547200 1100
258694679 Devil.Hunter B April 29, 2024, 1:13 p.m. OK Go TESTS 15 359 4300800 1100
261304774 treasuryonly B May 17, 2024, 9:17 a.m. OK Haskell TESTS 15 93 6246400 1100
261303986 treasuryonly B May 17, 2024, 9:10 a.m. OK Haskell TESTS 15 109 6246400 1100
262254277 rishit164 B May 23, 2024, 12:11 p.m. OK Java 21 TESTS 15 249 204800 1100
261047376 ramitg254 B May 15, 2024, 11:47 a.m. OK Java 21 TESTS 15 249 716800 1100
259550070 new2ac B May 4, 2024, 6:56 p.m. OK Java 21 TESTS 15 249 819200 1100
259773886 neralkattesanket B May 6, 2024, 3:44 p.m. OK Java 21 TESTS 15 264 0 1100
259336998 bhavaharan B May 3, 2024, 9:27 a.m. OK Java 21 TESTS 15 264 614400 1100
261046212 ramitg254 B May 15, 2024, 11:38 a.m. OK Java 21 TESTS 15 265 819200 1100
258802522 Festyve B April 30, 2024, 1:50 a.m. OK Java 21 TESTS 15 265 819200 1100
260884315 GoldenShadow B May 14, 2024, 6:19 a.m. OK Java 21 TESTS 15 265 1024000 1100
261526261 Kshitiz_san B May 18, 2024, noon OK Java 21 TESTS 15 280 614400 1100
260038447 v3n1v1c11v1c1 B May 8, 2024, 6:29 p.m. OK Java 21 TESTS 15 280 614400 1100
261437757 AttackDolphin215 B May 17, 2024, 10:06 p.m. OK Java 8 TESTS 15 155 0 1100
259793124 Blue_BEE B May 6, 2024, 6:44 p.m. OK Java 8 TESTS 15 155 0 1100
262856341 Ovetsar_ilish B May 27, 2024, 9:20 a.m. OK Java 8 TESTS 15 171 0 1100
262685339 tittiesboy99 B May 26, 2024, 9:59 a.m. OK Java 8 TESTS 15 171 0 1100
258779742 gdax B April 29, 2024, 6:31 p.m. OK Java 8 TESTS 15 171 0 1100
262359104 Sumitsingh7 B May 24, 2024, 9:01 a.m. OK Java 8 TESTS 15 171 6553600 1100
259622309 AgniWarrior B May 5, 2024, 11:04 a.m. OK Java 8 TESTS 15 186 0 1100
259508246 Friendly_ShirleyCCD B May 4, 2024, 12:33 p.m. OK Java 8 TESTS 15 186 0 1100
259866826 y_a_s B May 7, 2024, 11:31 a.m. OK Java 8 TESTS 15 187 0 1100
258847121 Pranav_Sharda B April 30, 2024, 11:49 a.m. OK Java 8 TESTS 15 187 0 1100
262930889 Frankenween B May 27, 2024, 8:14 p.m. OK Kotlin 1.9 TESTS 15 203 102400 1100
259013950 SlavaG B May 1, 2024, 1:43 p.m. OK Kotlin 1.9 TESTS 15 218 204800 1100
258998072 dkozak94 B May 1, 2024, 11 a.m. OK Kotlin 1.9 TESTS 15 218 307200 1100
258809631 gouravasdeo11 B April 30, 2024, 4:01 a.m. OK Kotlin 1.9 TESTS 15 296 0 1100
263215137 parth_7042 B May 30, 2024, 9:06 a.m. OK PHP TESTS 15 109 18944000 1100
260960998 misorin B May 14, 2024, 4:45 p.m. OK PyPy 3 TESTS 15 140 3174400 1100
259943078 Samaritan02 B May 8, 2024, 3:16 a.m. OK PyPy 3 TESTS 15 264 9420800 1100
261196431 zhengyi20thu B May 16, 2024, 12:42 p.m. OK PyPy 3 TESTS 15 280 9728000 1100
258778476 Maxi2721 B April 29, 2024, 6:23 p.m. OK PyPy 3 TESTS 15 436 9523200 1100
262171872 insipidintegrator B May 22, 2024, 4:48 p.m. OK PyPy 3 TESTS 15 468 9523200 1100
260427278 sanjay.garg2072 B May 10, 2024, 4:59 p.m. OK PyPy 3 TESTS 15 468 9523200 1100
258976605 Soshka B May 1, 2024, 7:15 a.m. OK PyPy 3 TESTS 15 499 9728000 1100
259611188 Kefrov B May 5, 2024, 9:24 a.m. OK PyPy 3 TESTS 15 499 9830400 1100
262441249 redstormguard B May 24, 2024, 10:18 p.m. OK PyPy 3 TESTS 15 515 9420800 1100
258756397 Kowshik.Emmadisetty B April 29, 2024, 4:13 p.m. OK PyPy 3 TESTS 15 515 25395200 1100
259008107 bergus B May 1, 2024, 12:46 p.m. OK PyPy 3-64 TESTS 15 124 4608000 1100
261214682 pogisinico B May 16, 2024, 2:56 p.m. OK PyPy 3-64 TESTS 15 140 5120000 1100
263113371 scyyyyyyyyyy B May 29, 2024, 8:45 a.m. OK PyPy 3-64 TESTS 15 140 7065600 1100
260905544 s2003 B May 14, 2024, 9:41 a.m. OK PyPy 3-64 TESTS 15 140 12902400 1100
262444146 NitroSpear B May 24, 2024, 11:49 p.m. OK PyPy 3-64 TESTS 15 155 12390400 1100
260762699 Youarenotgood B May 13, 2024, 7:58 a.m. OK PyPy 3-64 TESTS 15 171 5632000 1100
260638915 123Summertime B May 12, 2024, 9:10 a.m. OK PyPy 3-64 TESTS 15 171 6860800 1100
259062073 strashila B May 1, 2024, 9:57 p.m. OK PyPy 3-64 TESTS 15 187 7168000 1100
262518496 __yannick__ B May 25, 2024, 2:08 p.m. OK PyPy 3-64 TESTS 15 187 9318400 1100
259906833 SapperBeret B May 7, 2024, 5 p.m. OK PyPy 3-64 TESTS 15 187 12390400 1100
262868598 wzhabc B May 27, 2024, 11:04 a.m. OK Python 3 TESTS 15 124 0 1100
259563254 SigmaCat B May 4, 2024, 9:44 p.m. OK Python 3 TESTS 15 139 0 1100
259478139 gray-white-yellow B May 4, 2024, 8:41 a.m. OK Python 3 TESTS 15 139 0 1100
259452519 Kallala123 B May 4, 2024, 6:06 a.m. OK Python 3 TESTS 15 139 0 1100
263505729 gmanasa B May 31, 2024, 1:35 p.m. OK Python 3 TESTS 15 140 0 1100
262632701 orchidzz B May 26, 2024, 12:20 a.m. OK Python 3 TESTS 15 140 0 1100
261619088 sambhavvinayak16 B May 19, 2024, 7:50 a.m. OK Python 3 TESTS 15 140 0 1100
260580195 smugi B May 11, 2024, 7:36 p.m. OK Python 3 TESTS 15 140 0 1100
258782054 sidd_27 B April 29, 2024, 6:56 p.m. OK Python 3 TESTS 15 140 0 1100
258749991 sky_coder_ B April 29, 2024, 3:56 p.m. OK Python 3 TESTS 15 140 0 1100
259723113 cck111 B May 6, 2024, 8:46 a.m. OK Rust 2021 TESTS 15 46 0 1100
260592663 abdessamad.anssem B May 11, 2024, 11:34 p.m. OK Rust 2021 TESTS 15 61 0 1100
259766334 l_y_f B May 6, 2024, 2:40 p.m. OK Rust 2021 TESTS 15 77 0 1100
260786104 vjudge.4 B May 13, 2024, 11:17 a.m. OK Rust 2021 TESTS 15 109 0 1100

remove filters

Back to search problems