Codeforces Round 634 (Div. 3)

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
1335 Codeforces Round 634 (Div. 3) FINISHED False 7200 150564311 April 13, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2213 ) F Robots on a Grid PROGRAMMING data structures dfs and similar ds graphs greedy matrices 2600

B"There is a rectangular grid of size n x m . Each cell of the grid is colored black ('0') or white ('1'). The color of the cell (i, j) is c_{i, j} . You are also given a map of directions: for each cell, there is a direction s_{i, j} which is one of the four characters 'U', 'R', 'D' and 'L'. It is guaranteed that the top row doesn't contain characters 'U', the bottom row doesn't contain characters 'D', the leftmost column doesn't contain characters 'L' and the rightmost column doesn't contain characters 'R'. You want to place some robots in this field (at most one robot in a cell). The following conditions should be satisfied. The robots make an infinite number of moves. Your task is to place the maximum number of robots to satisfy all the conditions described above and among all such ways, you have to choose one where the number of black cells occupied by robots before all movements is the maximum possible. Note that you can place robots only before all movements. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 5 cdot 10^4 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains two integers n and m ( 1 < nm <= 10^6 ) -- the number of rows and the number of columns correspondingly. The next n lines contain m characters each, where the j -th character of the i -th line is c_{i, j} ( c_{i, j} is either '0' if the cell (i, j) is black or '1' if the cell (i, j) is white). The next n lines also contain m characters each, where the j -th character of the i -th line is s_{i, j} ( s_{i, j} is 'U', 'R', 'D' or 'L' and describes the direction of the cell (i, j) ). It is guaranteed that the sum of the sizes of fields does not exceed 10^6 ( sum nm <= 10^6 ). For each test case, print two integers -- the m"...

Tutorials

75993

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
77929739 keke_haha F April 24, 2020, 3:29 p.m. OK Clang++17 Diagnostics TESTS 86 842 258457600 2600
76786228 MudCoal F April 15, 2020, 10:43 a.m. OK GNU C11 TESTS 86 327 25292800 2600
77318487 time_interspace F April 20, 2020, 12:26 a.m. OK GNU C++11 TESTS 86 187 14336000 2600
77085475 dblark F April 17, 2020, 2:20 p.m. OK GNU C++11 TESTS 86 202 109056000 2600
76758957 wang9897 F April 15, 2020, 5:17 a.m. OK GNU C++11 TESTS 86 217 65228800 2600
77203488 luogu_bot2 F April 18, 2020, 4:15 p.m. OK GNU C++11 TESTS 86 217 89395200 2600
77076005 JJLeo F April 17, 2020, 12:55 p.m. OK GNU C++11 TESTS 86 218 80998400 2600
76692472 LOVE_YJZ F April 14, 2020, 12:39 p.m. OK GNU C++11 TESTS 86 233 57548800 2600
76672066 suxxsfe F April 14, 2020, 9:19 a.m. OK GNU C++11 TESTS 86 233 109260800 2600
76672155 luogu_bot1 F April 14, 2020, 9:20 a.m. OK GNU C++11 TESTS 86 233 109260800 2600
76688707 OIerwanhong F April 14, 2020, 12:05 p.m. OK GNU C++11 TESTS 86 233 110284800 2600
76670559 fried-chicken F April 14, 2020, 9:06 a.m. OK GNU C++11 TESTS 86 249 26112000 2600
76964313 jam1729 F April 16, 2020, 11:35 a.m. OK GNU C++14 TESTS 86 155 15667200 2600
76962660 jam1729 F April 16, 2020, 11:19 a.m. OK GNU C++14 TESTS 86 155 21606400 2600
76962895 jam1729 F April 16, 2020, 11:22 a.m. OK GNU C++14 TESTS 86 155 21606400 2600
76959024 jam1729 F April 16, 2020, 10:42 a.m. OK GNU C++14 TESTS 86 155 25702400 2600
77655827 kardeepak F April 22, 2020, 1:49 p.m. OK GNU C++14 TESTS 86 155 25702400 2600
76722724 popabogdannnn F April 14, 2020, 5:32 p.m. OK GNU C++14 TESTS 86 170 90828800 2600
76962474 jam1729 F April 16, 2020, 11:18 a.m. OK GNU C++14 TESTS 86 171 21708800 2600
76739325 yasharth234 F April 14, 2020, 9:03 p.m. OK GNU C++14 TESTS 86 171 25702400 2600
76749069 Rdpaula F April 15, 2020, 1:32 a.m. OK GNU C++14 TESTS 86 171 27955200 2600
77261272 nongnong F April 19, 2020, 9:52 a.m. OK GNU C++14 TESTS 86 171 40243200 2600
76734103 abdulrahman_aj F April 14, 2020, 7:39 p.m. OK GNU C++17 TESTS 86 109 12083200 2600
77206248 s1ddharth3 F April 18, 2020, 4:52 p.m. OK GNU C++17 TESTS 86 124 21094400 2600
76707659 abdulrahman_aj F April 14, 2020, 3:02 p.m. OK GNU C++17 TESTS 86 124 88166400 2600
76733078 hsnavarro F April 14, 2020, 7:26 p.m. OK GNU C++17 TESTS 86 124 90214400 2600
76732825 hsnavarro F April 14, 2020, 7:23 p.m. OK GNU C++17 TESTS 86 124 94208000 2600
77205709 s1ddharth3 F April 18, 2020, 4:44 p.m. OK GNU C++17 TESTS 86 124 97177600 2600
76668106 Test2311 F April 14, 2020, 8:26 a.m. OK GNU C++17 TESTS 86 140 20070400 2600
76704740 _overrated_ F April 14, 2020, 2:34 p.m. OK GNU C++17 TESTS 86 140 41164800 2600
76703707 _overrated_ F April 14, 2020, 2:25 p.m. OK GNU C++17 TESTS 86 140 41779200 2600
76680382 supriyanta F April 14, 2020, 10:41 a.m. OK GNU C++17 TESTS 86 155 18739200 2600
76697071 Scissors_Ss F April 14, 2020, 1:24 p.m. OK GNU C++17 (64) TESTS 86 140 20070400 2600
76727460 ankushkhanna F April 14, 2020, 6:20 p.m. OK GNU C++17 (64) TESTS 86 155 8192000 2600
76653248 ankushkhanna F April 14, 2020, 3:24 a.m. OK GNU C++17 (64) TESTS 86 155 12185600 2600
76703566 Scissors_Ss F April 14, 2020, 2:24 p.m. OK GNU C++17 (64) TESTS 86 155 20070400 2600
77961424 hugopm F April 24, 2020, 10:26 p.m. OK GNU C++17 (64) TESTS 86 156 48332800 2600
76715103 hitonanode F April 14, 2020, 4:12 p.m. OK GNU C++17 (64) TESTS 86 186 16998400 2600
76676986 Milan_ F April 14, 2020, 10:08 a.m. OK GNU C++17 (64) TESTS 86 233 64307200 2600
76664352 vjudge3 F April 14, 2020, 7:03 a.m. OK GNU C++17 (64) TESTS 86 233 90009600 2600
76707089 jyf111 F April 14, 2020, 2:57 p.m. OK GNU C++17 (64) TESTS 86 233 95539200 2600
76664031 vjudge5 F April 14, 2020, 6:56 a.m. OK GNU C++17 (64) TESTS 86 248 90009600 2600
76647332 synapse F April 14, 2020, 12:57 a.m. OK Go TESTS 86 655 161689600 2600
76693471 synapse F April 14, 2020, 12:49 p.m. OK Go TESTS 86 732 198041600 2600
76691503 synapse F April 14, 2020, 12:30 p.m. OK Go TESTS 86 733 198041600 2600
76702151 DATVN F April 14, 2020, 2:11 p.m. OK Java 11 TESTS 86 436 157286400 2600
77192100 mikkk F April 18, 2020, 2:18 p.m. OK Java 11 TESTS 86 1170 256204800 2600
77008611 ykabaran F April 16, 2020, 6:48 p.m. OK Java 11 TESTS 86 1262 78131200 2600
77897660 tusharjape007 F April 24, 2020, 9:20 a.m. OK Java 11 TESTS 86 1341 260198400 2600
76706626 jenish9599 F April 14, 2020, 2:53 p.m. OK Java 11 TESTS 86 1356 260198400 2600
77130069 dg2004 F April 17, 2020, 10:52 p.m. OK Java 8 TESTS 86 670 143769600 2600
77606168 jxin31415 F April 22, 2020, 4:19 a.m. OK Java 8 TESTS 86 779 135372800 2600
76644057 YahiaSherif F April 13, 2020, 11:16 p.m. OK Java 8 TESTS 86 795 81203200 2600
76650226 DanielW48 F April 14, 2020, 2:17 a.m. OK Java 8 TESTS 86 982 258867200 2600
76753189 muhandae F April 15, 2020, 3:21 a.m. OK Java 8 TESTS 86 1013 152576000 2600
76688360 polyakoff F April 14, 2020, 12:02 p.m. OK Java 8 TESTS 86 1075 220876800 2600
77544053 sgt F April 21, 2020, 3:52 p.m. OK Java 8 TESTS 86 1263 268390400 2600
76648321 Java F April 14, 2020, 1:25 a.m. OK Java 8 TESTS 86 1356 258867200 2600
77066625 tsumit023 F April 17, 2020, 11:24 a.m. OK Java 8 TESTS 86 1981 258764800 2600
76734649 WashRoom F April 14, 2020, 7:46 p.m. OK Java 8 TESTS 86 2011 258969600 2600
76783158 lucifer1005 F April 15, 2020, 10 a.m. OK Kotlin TESTS 86 1092 148684800 2600
76656324 camypaper F April 14, 2020, 4:19 a.m. OK Mono C# TESTS 86 639 77107200 2600
76687588 LeeLdler F April 14, 2020, 11:53 a.m. OK MS C++ 2017 TESTS 86 358 127385600 2600
76691978 DmitryZ F April 14, 2020, 12:34 p.m. OK MS C++ 2017 TESTS 86 374 9318400 2600
76669234 60D9 F April 14, 2020, 8:43 a.m. OK MS C++ 2017 TESTS 86 702 96153600 2600
76735241 danilgrig F April 14, 2020, 7:54 p.m. OK MS C++ 2017 TESTS 86 873 163225600 2600
76682669 yarden.porat F April 14, 2020, 11:07 a.m. OK MS C++ 2017 TESTS 86 1060 218419200 2600
76691030 youness.amhaouch F April 14, 2020, 12:26 p.m. OK PyPy 2 TESTS 86 1762 242585600 2600
76714155 aberent F April 14, 2020, 4:03 p.m. OK PyPy 3 TESTS 86 951 143667200 2600
76688439 aberent F April 14, 2020, 12:03 p.m. OK PyPy 3 TESTS 86 997 124108800 2600
76789059 Khan17 F April 15, 2020, 11:18 a.m. OK PyPy 3 TESTS 86 1356 198553600 2600
76705162 auouo F April 14, 2020, 2:38 p.m. OK PyPy 3 TESTS 86 1871 226816000 2600
76653849 sansen F April 14, 2020, 3:35 a.m. OK Rust TESTS 86 514 82534400 2600
76738876 Tashm F April 14, 2020, 8:55 p.m. OK Rust TESTS 86 998 83148800 2600

remove filters

Back to search problems