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.
Problems
B'There is a field divided into n rows and m columns. Some cells are empty (denoted as E), other cells contain robots (denoted as R). You can send a command to all robots at the same time. The command can be of one of the four types: When you send a command, all robots at the same time attempt to take one step in the direction you picked. If a robot tries to move outside the field, it explodes; otherwise, every robot moves to an adjacent cell in the chosen direction. You can send as many commands as you want (possibly, zero), in any order. Your goal is to make at least one robot reach the upper left corner of the field. Can you do this without forcing any of the robots to explode? The first line contains one integer t ( 1 <= t <= 5000 ) -- the number of test cases. Each test case starts with a line containing two integers n and m ( 1 <= n, m <= 5 ) -- the number of rows and the number of columns, respectively. Then n lines follow; each of them contains a string of m characters. Each character is either E (empty cell} or R (robot). Additional constraint on the input: in each test case, there is at least one robot on the field. If it is possible to make at least one robot reach the upper left corner of the field so that no robot explodes, print YES. Otherwise, print NO. Explanations for test cases of the example: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
157072608 |
Salamander1983 |
B |
May 13, 2022, 4:31 p.m. |
OK |
C# 10 |
TESTS |
5 |
77 |
4403200 |
|
|
157070460 |
TheILICH |
B |
May 13, 2022, 4:25 p.m. |
OK |
C# 8 |
TESTS |
5 |
108 |
3276800 |
|
|
157079865 |
zolind77 |
B |
May 13, 2022, 5:18 p.m. |
OK |
C# 8 |
TESTS |
5 |
109 |
3072000 |
|
|
157080447 |
rknarayan076 |
B |
May 13, 2022, 5:24 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
5 |
233 |
1024000 |
|
|
157064202 |
MorningStar_ |
B |
May 13, 2022, 4:06 p.m. |
OK |
GNU C++14 |
TESTS |
5 |
0 |
0 |
|
|
157083377 |
kod3zilla |
B |
May 13, 2022, 5:54 p.m. |
OK |
GNU C++14 |
TESTS |
5 |
0 |
102400 |
|
|
157117578 |
StevenLu1103 |
B |
May 14, 2022, 5:58 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157117402 |
jsparrow08 |
B |
May 14, 2022, 5:56 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157117070 |
vansh_69420 |
B |
May 14, 2022, 5:51 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157116520 |
Arbaaz |
B |
May 14, 2022, 5:44 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157114924 |
harry_122 |
B |
May 14, 2022, 5:19 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157114889 |
Iamryan7 |
B |
May 14, 2022, 5:19 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157113993 |
forlight |
B |
May 14, 2022, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
157113972 |
RED_MONK |
B |
May 14, 2022, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
5 |
15 |
0 |
|
|
remove filters
Back to search problems