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"The only difference between the two versions of this problem is the constraint on q . You can make hacks only if both versions of the problem are solved. Thomas is sailing around an island surrounded by the ocean. The ocean and island can be represented by a grid with n rows and m columns. The rows are numbered from 1 to n from top to bottom, and the columns are numbered from 1 to m from left to right. The position of a cell at row r and column c can be represented as (r, c) . Below is an example of a valid grid. There are three types of cells: island, ocean and underwater volcano. Cells representing the island are marked with a '#', cells representing the ocean are marked with a '.', and cells representing an underwater volcano are marked with a 'v'. It is guaranteed that there is at least one island cell and at least one underwater volcano cell. It is also guaranteed that the set of all island cells forms a single connected component ^{ dagger} and the set of all ocean cells and underwater volcano cells forms a single connected component. Additionally, it is guaranteed that there are no island cells at the edge of the grid (that is, at row 1 , at row n , at column 1 , and at column m ). Define a round trip starting from cell (x, y) as a path Thomas takes which satisfies the following conditions: The safety of a round trip is the minimum Manhattan distance ^{ ddagger} from a cell on the round trip to an underwater volcano (note that the presence of island cells does not impact this distance). You have q queries. A query can be represented as (x, y) and for every query, you want to find the maximum safety of a round trip starting from (x, y) . It is guaranteed that (x, y) is an ocean cell or an underwater volcano cell. ^{ dagger} A set of cells forms a single connected component if from any cell of this set it is possible to reach any o"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
241516099 |
Valters07 |
F2 |
Jan. 14, 2024, 12:12 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
420 |
40550400 |
|
|
241485214 |
StarSilk |
F2 |
Jan. 13, 2024, 4:33 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
498 |
84582400 |
|
|
241530409 |
EvenToWorldFinal |
F2 |
Jan. 14, 2024, 5:39 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
1045 |
128409600 |
|
|
241519708 |
ahihi1234 |
F2 |
Jan. 14, 2024, 2:17 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
1418 |
88883200 |
|
|
241509367 |
honey |
F2 |
Jan. 13, 2024, 8:46 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
2651 |
304025600 |
|
|
241500899 |
NisarAhmad_ |
F2 |
Jan. 13, 2024, 6:46 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
202 |
20377600 |
|
|
241500254 |
peti1234 |
F2 |
Jan. 13, 2024, 6:39 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
358 |
55500800 |
|
|
241505645 |
bktl1love |
F2 |
Jan. 13, 2024, 7:47 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
1216 |
105062400 |
|
|
241483543 |
ppavic |
F2 |
Jan. 13, 2024, 4:30 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
1231 |
104755200 |
|
|
241512765 |
Dominater069 |
F2 |
Jan. 13, 2024, 10:04 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
1528 |
97792000 |
|
|
241526268 |
Kilani |
F2 |
Jan. 14, 2024, 4:38 a.m. |
OK |
GNU C++17 |
TESTS |
38 |
3447 |
877568000 |
|
|
241492533 |
Sayem_Ramzan |
F2 |
Jan. 13, 2024, 5:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
763 |
191590400 |
|
|
241499150 |
Godjob |
F2 |
Jan. 13, 2024, 6:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
779 |
99328000 |
|
|
241515126 |
lunchbox |
F2 |
Jan. 13, 2024, 11:29 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
795 |
28774400 |
|
|
241499605 |
Godjob |
F2 |
Jan. 13, 2024, 6:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
857 |
99328000 |
|
|
241511800 |
Geothermal |
F2 |
Jan. 13, 2024, 9:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
935 |
34713600 |
|
|
241511434 |
MarcosK |
F2 |
Jan. 13, 2024, 9:27 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
1310 |
182067200 |
|
|
241499121 |
Godjob |
F2 |
Jan. 13, 2024, 6:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
1419 |
124211200 |
|
|
241528219 |
luanmenglei |
F2 |
Jan. 14, 2024, 5:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
1622 |
172646400 |
|
|
241526581 |
tenkei |
F2 |
Jan. 14, 2024, 4:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
1933 |
156876800 |
|
|
241491880 |
awesomeguy856 |
F2 |
Jan. 13, 2024, 5:31 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
171 |
23552000 |
|
|
241513635 |
FelixMirave |
F2 |
Jan. 13, 2024, 10:33 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
233 |
52326400 |
|
|
241515334 |
neal |
F2 |
Jan. 13, 2024, 11:38 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
264 |
142950400 |
|
|
241531806 |
propane |
F2 |
Jan. 14, 2024, 5:56 a.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
265 |
57446400 |
|
|
241507488 |
neal |
F2 |
Jan. 13, 2024, 8:14 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
280 |
142950400 |
|
|
241512642 |
Be_dos |
F2 |
Jan. 13, 2024, 10 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
295 |
90419200 |
|
|
241484759 |
femboy-wannabe |
F2 |
Jan. 13, 2024, 4:32 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
327 |
96460800 |
|
|
241508545 |
hayley17 |
F2 |
Jan. 13, 2024, 8:31 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
374 |
207155200 |
|
|
241495965 |
kto_eto |
F2 |
Jan. 13, 2024, 6 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
420 |
207155200 |
|
|
241500415 |
_qwqUwU |
F2 |
Jan. 13, 2024, 6:41 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
530 |
223744000 |
|
|
241484565 |
arvindf232 |
F2 |
Jan. 13, 2024, 4:32 p.m. |
OK |
Kotlin 1.6 |
TESTS |
38 |
1013 |
172236800 |
|
|
remove filters
Back to search problems