#P3395. 路障
路障
Output Format
For each test case, output Yes or No, answering whether B can reach .
2
2
1 1
2 2
5
3 3
3 2
3 1
1 2
1 3
1 4
1 5
2 2
Yes
Yes
Hint
Sample explanation:
Here 0 means passable, x means blocked, and B means B's current position. From left to right represents time.
Case 1:
0 0 0 0 0 B (already reached)
B 0 x B x 0
Case 2:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 x 0 0 0 0 x 0 0 0 0 x 0 0
0 0 0 0 0 0 0 0 0 0 0 0 x 0 0 0 0 x 0 0
B 0 0 0 0 0 B 0 0 0 0 0 B 0 0 0 0 x B 0 ......(B can reach the target)
Constraints:
- To prevent score farming, all testdata are handcrafted.
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号