Description

有一天,小鴨在玩走迷宮遊戲。但他發現迷宮有漏洞,導致可以走到迷宮外面,然後再從另一側繞回來,這樣就不用認真解了!

現在給你一張 $w \times h$ 的地圖,其中 . 代表空地、# 代表牆壁,請你找出是否有路徑可以從 $(x_0, y_0)$ 走到 $(x_1,y_1)$

Input Format

第一行有兩個數字 $w$ 和 $h$
接下來 $h$ 行每行是 $w$ 個連續字元,代表迷宮的地形
最後一行有四個數字分別是 $x_0$、$y_0$、$x_1$、$y_1$

條件:

$0 < w < 1000$
$0 < h < 1000$
$x_0$、$y_0$、$x_1$、$y_1$ 接落在 $(-1000, 1000)$
起點和終點保證不會是牆壁

Output Format

若路徑存在,輸出 Hehe,否則輸出 Bruh

Sample Input 1

7 8
#######
#......
#.##..#
#..####
#..#..#
#.###.#
#.#...#
###.###
1 1 5 6

Sample Output 1

Hehe

Sample Input 2

5 5
#####
#...#
#.###
#.#.#
#####
3 1 3 3

Sample Output 2

Bruh

Hints

Problem Source

我保證這是最後一題裸題了

TopCoder


$\texttt{<script>alert(":3");</script>}$

User's AC Ratio

100.0% (1/1)

Tags

Problem Setter

Created by

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 20
2 2~9 80

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 2
3 1000 65536 65536 2
4 1000 65536 65536 2
5 1000 65536 65536 2
6 1000 65536 65536 2
7 1000 65536 65536 2
8 1000 65536 65536 2
9 1000 65536 65536 2