#P1789. 【Mc生存】插火把
【Mc生存】插火把
Description
One day, linyorson created an square grid in Minecraft. He has torches and glowstones, placed at positions through and through , respectively. Any cell that has no light and has nothing placed on it will spawn monsters. How many cells in this grid will spawn monsters?
Note: In this problem the illumination ranges of torches and glowstone are different from the original Minecraft. Please follow the description given here.
P.S. The illumination range of a torch is:
| Dark | Light | Dark | ||
|---|---|---|---|---|
| Dark | Light | Light | Light | Dark |
| Light | Torch | Light | ||
| Dark | Light | Dark | ||
| Dark | Dark | |||
Glowstone:
| Light | ||||
|---|---|---|---|---|
| Light | Light | Light | ||
| Glowstone | ||||
| Light | ||||
Input Format
There are lines in total.
The first line contains .
Lines through give the positions of torches .
Lines through give the positions of glowstones .
Note: There may be no glowstone, but there is at least one torch.
Output Format
Output the number of cells that will spawn monsters.
5 1 0
3 3
12
Hint
Constraints: , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号